MySQL Forums
Forum List  »  Full-Text Search

Am I missunderstanding the syntax?
Posted by: Alex Ramirez
Date: May 10, 2006 09:01AM

Hi. I'm looking for the SQL to accomplish this:

I need, full text search to get this done:

('word1*' AND 'word2*') OR ('word1+word2')

This is, be able to search for some like:

('apple*' AND 'banana*') OR ('applebanana')

And I'm sure that one of my rows has this in the field I'm looking into:

"oranges applepie banana milk"

Hence should be returned because of the 'apple*' AND because of the 'banana*'.

According to the MySQL doc, I need to do this, to search my field:

SELECT myfield FROM mytable WHERE
MATCH (myfield) AGAINST ('(+apple* +banana*) applebanana' IN BOOLEAN MODE);

But that returns nothing.

By using this:

SELECT myfield FROM mytable WHERE
MATCH (myfield) AGAINST ('(+apple* +banana*) aaaaa' IN BOOLEAN MODE);

I do get the result I want, becasue nothing matches the 'aaaaa' and hence I must be doing something wrong. Possibly, because 'applebanana' is within the scope of the '+apple*' part, but I still cannot find a way to get this simple ((A AND B) OR (A+B)) with the strings.

What am I doing wrong?
How can I get this ('apple*' AND 'banana*') OR ('applebanana') done?

Any help will be appreciated.


Edited 1 time(s). Last edit at 05/18/2006 09:26AM by Alex Ramirez.

Options: ReplyQuote

Written By
Am I missunderstanding the syntax?
May 10, 2006 09:01AM

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.