MYSQL Match example doesn't work. Is the Spa a stopover?

SELECT * FROM mytable WHERE match(fieldname) against('spa')

      

I don't understand why this query is not returning any results. It should find at least 10 lines with spa in. Spa is not a keyword / stop word?

+3


source to share


3 answers


The minimum and maximum lengths of words to be indexed are determined by the ft_min_word_len and ft_max_word_len system variables. The default minimum is four characters ; the default maximum size depends on the version. If you change the 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 placing the following lines in your options file:

[mysqld]
ft_min_word_len=3

      



Then restart the server and rebuild your FULLTEXT indexes. Pay special attention to the notes regarding myisamchk in the instructions following this list.

Source: http://dev.mysql.com/doc/refman/5.1/en/fulltext-fine-tuning.html

+5


source


No, spa is not one of the standard words by default, but there is a minimum word length in MySQL full text search, which I think the default is 4: ft_min_word_length



0


source


For searches, the minimum length is four characters. However, it looks like the searchability could be changed

Tuning MySQL Full-Text Search

MySQL full-text search capability has few user-configurable options. You can have more control over full-text search if you have a source distribution of MySQL, because some changes require the source of the code change. See Section 2.17 "Installing MySQL from Source".

Please note that full text search is carefully tuned for most efficiency. In most cases, changing the default behavior can actually degrade performance. Don't change MySQL sources if you know what you are doing.

Most of the full-text variables described in this section must be set at server startup. Changing them requires a server restart; They cannot be changed while the server is running.

Some variable changes require you to rebuild the FULLTEXT indexes on your tables. Instructions for this are provided later in this section.

The minimum and maximum lengths of words to be indexed are determined by the formula ft_min_word_len and ft_max_word_len system variables. (See Section 5.1.3, “Server System Variables.”) The default minimum is four characters; the default maximum size depends on the version. If you change either value, you must rebuild your FULLTEXT indexes. For example, if you want three-digit words to be searchable, you can set ft_min_word_len by putting the following lines in the File parameter:

[mysqld] 
ft_min_word_len=3 

      

Then restart the server and rebuild the FULLTEXT Indexes. Please note, in particular, the notes regarding myisamchk in the instructions following this list.

0


source







All Articles