mardi 14 juin 2016

FULLTEXT Index fails to return result in MySQL

I have a FULLTEXT index on a VARCHAR column. I search for content in this coulumn as such:

SELECT ID,NAME FROM people WHERE MATCH(people.NAME) AGAINST (? IN BOOLEAN MODE);

To my parameter I would for instance bind this value: +firstname* +lastname* - and in most cases this will return expected results. However, in edge cases I don't understand, this fails to match. Take this example:

The name in the column is Liliana De Lima. If I bind this value: +liliana* it will find the row. If I bind this value: +liliana* +d* it does not. Why?

Normally I have no problems binding multiple words with the above logic. For instance, binding the value +peter* +p* will return a result for the name Peter Prip.

Aucun commentaire:

Enregistrer un commentaire