Skip to main content
added 150 characters in body
Source Link
RolandoMySQLDBA
  • 184.4k
  • 33
  • 323
  • 531

@John.Locke's answer hits the nail on the head. +1 on your answer.

@DTest's comment confirmed it. +1 on your comment.

Here is how to get around it:

Step 01) Create an empty stopword list

$ echo -n > /var/lib/mysql/stopwords.txt

Optional : Make the stopword list have articles (no pun intended) 'a','an','the'

$ echo "a"    > /var/lib/mysql/stopwords.txt
$ echo "an"  >> /var/lib/mysql/stopwords.txt
$ echo "the" >> /var/lib/mysql/stopwords.txt

Step 02) Configure mysql to accept everything in FULLTEXT indexes minus your custom stopwords

[mysqld]
ft_min_word_len=1
ft_stopword_file=/var/lib/mysql/stopwords.txt

Step 03) Restart mysql

$ service mysql restart

Step 04) Reindex the table

mysql> ALTER TABLE articles DROP INDEX body;
mysql> ALTER TABLE articles ADD FULLTEXT (body);

Give it a Try !!!

CAVEAT

Anytime you reindex a FULLTEXT index after customzing to allow more words to be indexed, that resulting index with definitely be bigger.

@John.Locke's answer hits the nail on the head. +1 on your answer.

@DTest's comment confirmed it. +1 on your comment.

Here is how to get around it:

Step 01) Create an empty stopword list

$ echo -n > /var/lib/mysql/stopwords.txt

Optional : Make the stopword list have articles (no pun intended) 'a','an','the'

$ echo "a"    > /var/lib/mysql/stopwords.txt
$ echo "an"  >> /var/lib/mysql/stopwords.txt
$ echo "the" >> /var/lib/mysql/stopwords.txt

Step 02) Configure mysql to accept everything in FULLTEXT indexes minus your custom stopwords

[mysqld]
ft_min_word_len=1
ft_stopword_file=/var/lib/mysql/stopwords.txt

Step 03) Restart mysql

$ service mysql restart

Step 04) Reindex the table

mysql> ALTER TABLE articles DROP INDEX body;
mysql> ALTER TABLE articles ADD FULLTEXT (body);

Give it a Try !!!

@John.Locke's answer hits the nail on the head. +1 on your answer.

@DTest's comment confirmed it. +1 on your comment.

Here is how to get around it:

Step 01) Create an empty stopword list

$ echo -n > /var/lib/mysql/stopwords.txt

Optional : Make the stopword list have articles (no pun intended) 'a','an','the'

$ echo "a"    > /var/lib/mysql/stopwords.txt
$ echo "an"  >> /var/lib/mysql/stopwords.txt
$ echo "the" >> /var/lib/mysql/stopwords.txt

Step 02) Configure mysql to accept everything in FULLTEXT indexes minus your custom stopwords

[mysqld]
ft_min_word_len=1
ft_stopword_file=/var/lib/mysql/stopwords.txt

Step 03) Restart mysql

$ service mysql restart

Step 04) Reindex the table

mysql> ALTER TABLE articles DROP INDEX body;
mysql> ALTER TABLE articles ADD FULLTEXT (body);

Give it a Try !!!

CAVEAT

Anytime you reindex a FULLTEXT index after customzing to allow more words to be indexed, that resulting index with definitely be bigger.

Source Link
RolandoMySQLDBA
  • 184.4k
  • 33
  • 323
  • 531

@John.Locke's answer hits the nail on the head. +1 on your answer.

@DTest's comment confirmed it. +1 on your comment.

Here is how to get around it:

Step 01) Create an empty stopword list

$ echo -n > /var/lib/mysql/stopwords.txt

Optional : Make the stopword list have articles (no pun intended) 'a','an','the'

$ echo "a"    > /var/lib/mysql/stopwords.txt
$ echo "an"  >> /var/lib/mysql/stopwords.txt
$ echo "the" >> /var/lib/mysql/stopwords.txt

Step 02) Configure mysql to accept everything in FULLTEXT indexes minus your custom stopwords

[mysqld]
ft_min_word_len=1
ft_stopword_file=/var/lib/mysql/stopwords.txt

Step 03) Restart mysql

$ service mysql restart

Step 04) Reindex the table

mysql> ALTER TABLE articles DROP INDEX body;
mysql> ALTER TABLE articles ADD FULLTEXT (body);

Give it a Try !!!