This is a discussion on Help with greedy query within the MySQL Database forums, part of the Database Forums category; I have a compiled query that is very greedy. It will compile something like this: words LIKE "%word%" ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have a compiled query that is very greedy.
It will compile something like this: words LIKE "%word%" AND word LIKE "%word%".... for each work the user searches for. I have fulltext search as well, but what Im trying to do is produce a search result where all the words are in the words col. Do I have better options then what Im using at this time? |
|
|||
|
l3vi wrote: > I have a compiled query that is very greedy. > > It will compile something like this: > > words LIKE "%word%" AND word LIKE "%word%".... for each work the user > searches for. > > I have fulltext search as well, but what Im trying to do is produce a > search result where all the words are in the words col. > > Do I have better options then what Im using at this time? You can use fulltext search syntax to include all the matches instead of using AND. Try something like : SELECT * FROM your_table WHERE MATCH (yourfield1,yourfield2) AGAINST ('+word1 +word2 +word3' IN BOOLEAN MODE) Hope this helps! -cheers, Manish |