If I have a table with a MySQL TEXT
(or VARCHAR
) column with a FULLTEXT
index, with the rows possibly containing one or several of any given queried words, and I then run a standard query along the lines of:
SELECT *
FROM my_library
WHERE MATCH (content)
AGAINST ("cats dogs horse rainbow")
...then, since all of the words to be matched are by definition optional, can I regardless be certain that all rows matching any/several of the query words are returned, with the following exceptions:
- When a stopword is the only matching term in the query for a given row
- Any words shorter than minimum indexing length (InnoDB < 3, MyISAM < 4)
- Any words longer than maximum indexing length (InnoDB > 84)
- With case mismatch (when using
_cs
and_bin
collations) - Any words appearing in more than 50% of results (for MyISAM)
- If the FULLTEXT index isn't rebuilt after certain configuration changes (reference)
- When using
LIMIT
on a table notOPTIMIZE
d following row deletion (reference)
I could create test cases, however they would be tedious to analyze, would require massive volume to ensure consistency when searching larger datasets, and would still not be conclusive. (Therefore, no linked SQL fiddle or test data for this question.) I couldn't find a definite statement on this in the reference manual (natural, boolean); which is what I'm looking for.
I have material in need of review, and I need to ensure that all rows matching any queried words are indeed returned for a given query. I assume they are, but I don't have the luxury to assume here, only to have stuff fall through the cracks with quirky behavior. I need to guarantee that no content to be reviewed is omitted from a query expected to match all.
Finally: Whatever the answer may be, does it apply equally to InnoDB and MyISAM; and MySQL and MariaDB (current versions); with natural and boolean mode (without operators)? Are there cases where some potentially matching rows might not be returned?