MySQL Forums
Forum List  »  Newbie

Boolean and unexpected results
Posted by: Tom Calthrop
Date: January 04, 2017 04:26AM

Hi All,

After years of happy use MySQL baffled me today. I hope someone can explain this to me:

I have a table called "customers". It contains fields firstname, surname, middlename and nickname; all of which are VARCHAR (50). The storage engine is MyISAM.

We have a customer called Jay Hanks and another Patricia Hanks (with a middle name of Jane).

If I run this query:

SELECT * FROM customer WHERE MATCH (surname, firstname, middlename, nickname) AGAINST ('+j* +hanks*'IN BOOLEAN MODE) ORDER BY MATCH (surname, firstname, middlename, nickname) AGAINST ('+j* +hanks*' IN BOOLEAN MODE) DESC

both are returned, but if I run this query:

SELECT * FROM customer WHERE MATCH (surname, firstname, middlename, nickname) AGAINST ('+ja* +hanks*'IN BOOLEAN MODE) ORDER BY MATCH (surname, firstname, middlename, nickname) AGAINST ('+ja* +hanks*' IN BOOLEAN MODE) DESC

help! I don't get how '+j* +hanks*' will return Jay Hanks, but '+ja* +hanks*' won't.

Someone school me - please :-)

Tom

Options: ReplyQuote


Subject
Written By
Posted
Boolean and unexpected results
January 04, 2017 04:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.