views:

35

answers:

2

So apparently if a Mysql table's fulltext index contains a keyword that appears in 50% of the data rows, that keyword will be ignored by the match query

So if I have a table with the fulltext index 'content' which contains 50 entries and 27 of the entries contains the word 'computer' in the content field, and I run the query:

SELECT * 
  FROM `table` 
 WHERE MATCH(`content`) AGAINST ('computer'); 

...the computer query will return zero results since computer appears in more than 50% of the entries and hence the keyword is ignored...

is there a way to disable this functionality especially since this is problematic in the beginning phase of the database's lifespan

+2  A: 

Use BOOLEAN full-text searches to bypass 50% feature.

http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html

Māris Kiseļovs
A: 

Yes, use the Boolean Full-Text Searched option

See here Mysql Manual

The manual says that "They do not use the 50% threshold."

The search in MySQL is not intuitive and the manual is slightly confusing so you need to read it carefully as well as preparing some test cases to make sure it is working and that you have implemented it correctly (from bitter experience).

There are a number of other search plugin's of varying complexity that you might want to look at that perform better but it is worth getting to grips with the native version as it is quick and (easy?) dirty.

PurplePilot