MySQL Forums
Forum List  »  Full-Text Search

Can I search against multiple keywords at once
Posted by: sricharan vemuri
Date: March 12, 2010 03:11PM

I am trying to write a query where I will need to do a fulltext search against multiple words. Example: At any point i get a set of words lets assume apple, car, airplane are the three keywords the user enters in the search box.
Then I will write a query that says

select * from table1 where
(MATCH (col1,col2) against("apple") OR
(MATCH (col1,col2) against("car") OR
(MATCH (col1,col2) against("airplane"))

My question is.. Is there a way I can rewrite the above query so that I do not need to use the MATCH three times .. Can I write something like this

select * from table1 where
(MATCH (col1,col2) against("apple|car|airplane")

Thank You

Edited 1 time(s). Last edit at 03/12/2010 03:21PM by sricharan vemuri.

Options: ReplyQuote

Written By
Can I search against multiple keywords at once
March 12, 2010 03:11PM

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.