I've setup a full text index on a small selection of records across 3 fields (tried a combination of the 3 as well and had the same result), and some words return results fine, but certain ones such as 'house' and 'australia' don't (interestingly, 'australian' and 'home' do).
It seems like odd behaviour. If I add "WITH QUERY EXPANSION" I get results, but they aren't the most relevant now.
Anyone got any idea why this is? Otherwise I'm going to have to resort to using LIKE searches, and I'd prefer to have relevancy included.
The basic query format of full-text searches in MySQL should be similar to the following: SELECT * FROM table WHERE MATCH(column) AGAINST(“string” IN NATURAL LANGUAGE MODE); When MATCH() is used together with a WHERE clause, the rows are automatically sorted by the highest relevance first.
MySQL has support for full-text indexing and searching: A full-text index in MySQL is an index of type FULLTEXT . Full-text indexes can be used only with InnoDB or MyISAM tables, and can be created only for CHAR , VARCHAR , or TEXT columns.
Full-text indexes can be used only with MyISAM, Aria, InnoDB and Mroonga tables, and can be created only for CHAR, VARCHAR, or TEXT columns.
The columns in the fulltext index can be placed in any sort of order, but all the columns as specified when creating the fulltext index must be referenced in the match() query.
It could be a couple of things:
If you search Google for "mysql stop words" you'll find a lot more about it, as it's one of those things that catches a lot of people out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With