At 10:24 PM 6/28/2004, you wrote:
>I am looking for information on the proper way to code full text queries
>and more information on how they work.
http://dev.mysql.com/doc/mysql/en/Fulltext_Search.html
>I am especially interested in how to code for multi word queries...
>
>for example :
>
>Searching for : 'today is the day'
>
>Select * from table1 where match field1 against ('today is the day' IN
>BOOLEAN MODE) ????
>Select * from table1 where match field1 against ('today or is or the or
>day' IN BOOLEAN MODE) ????
>
>What is the difference between using or not using IN BOOLEAN MODE?
http://dev.mysql.com/doc/mysql/en/Fulltext_Boolean.html
With boolean mode it must contain all words. Row results are not ranked.
If not using boolean mode, it will rank the results with the rows that have
the most word occurances at the top of the list.
>What is the best way to allow people to also search for "today is the day"
>in quotes--- literal string...
If it has to be an example match then:
select * from table where memo like '%today is the day%';
Unfortunately this is the slowest way to search. It's fine if you have only
a few hundred rows. Fulltext search will choose records where the words
appear in any order so it will find "the day is today".
BTW, I suppose you know MySQL by default does not index words that have
fewer than 3 letters. MySQL 4.1 (4.0?) has a configuration option that
allows you to change this min word size. Otherwise in your example it will
only find "today" because "is", "the" and "day" are too small. See
"ft_min_word_len" Besides, these words are very common and may appear in
the exclude word list. This can also be changed in 4.1 but indexing common
works will of course create a much larger index.
Mike