Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    15

    Unanswered: fulltext search help needed

    Hello all,

    I have two identical queries (see below) and for some reason the first one returns data while the second does not (empty result set). Note, the database does contain data to return in both cases.

    Can someone shed some light on it? Thanks a lot!

    1) SELECT field1, field2, field3 FROM mytb WHERE match(field1,field2) against('mysql' IN BOOLEAN MODE)

    2) SELECT field1, field2, field3 FROM mytb WHERE match(field1,field2) against('php' IN BOOLEAN MODE)

  2. #2
    Join Date
    Oct 2003
    Posts
    15
    I think I've answered my own question now. fulltext feature won't index search terms shorter than 4 characters long (hence 'PHP' search term does not work).

    Does anyone know if this is configurable?

    Thanks,
    James

  3. #3
    Join Date
    Oct 2003
    Posts
    63
    Sure, you may change the maximum length of words for fulltext search. Let me quote the mysql reference manual:

    The minimum and maximum length of words to be indexed is defined by the ft_min_word_len and ft_max_word_len system variables (available as of MySQL 4.0.0). See Section 5.2.3, “Server System Variables”. The default minimum value is four characters. The default maximum depends on your version of MySQL. If you change either value, you must rebuild your FULLTEXT indexes. For example, if you want three-character words to be searchable, you can set the ft_min_word_len variable by putting the following lines in an option file:

    [mysqld]
    ft_min_word_len=3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •