user1055645
user1055645

Reputation:

mysql fulltext! do not ignore anything

Currently, my db ignores words such as what, all. How can I stop db from ignoring these kinds of words, abbs etc.?

If you need to look at my sql command:

SELECT *, MATCH(title,body) AGAINST('*what*' IN BOOLEAN MODE) AS sort
FROM articles  WHERE MATCH(title,body) AGAINST('*what*' IN BOOLEAN MODE) ORDER BY sort DESC LIMIT 20;

Upvotes: 0

Views: 163

Answers (2)

Igor Chudov
Igor Chudov

Reputation: 41

I have use mysql for over a decade and dealt with this stuff for about 3 years. I must say that I find MySQL's approach to not index three letter words and below, and in addition, ignoring an extremely arbitrary list of frequently occurring keywords, to be right on the border between stupidity and malice.

For example, MySQL assumes that the user would never search for "course" or "Kim" or "FBI". This is as stupid as it might possibly get!

To make matters worse, these settings are a part of a config file that gets overwritten with OS updates, returning this behavior after system updates, and contaminating fulltext index with the results of inconsistent policies that would occur between OS update and subsequent changes to my.cnf.

There is no justification for making this the default behavior.

I got sick enough of all this today that I wrote a shell function to edit my.cnf and effect these changes automatically. It runs after every system update as part of my general night maintenance script.

[mysqld]
ft_stopword_file=""
ft_min_word_len=0

Upvotes: 1

konsolenfreddy
konsolenfreddy

Reputation: 9671

whatis included within the stopwords.

Take a look at MySQL 5.5 stopwords

You can change the ft_stopword_file system variable and load a different set of stopwords (or just exclude what), see MySQL 5.5 finetuning

in 5.6 it's even possible to change the stopwords on a per-table basis (InnoDB only though). MySQL 5.6 stopwords

Upvotes: 1

Related Questions