Bluehost.com Web Hosting $6.95

Help with greedy query

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%" ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-13-2006
l3vi
 
Posts: n/a
Default Help with greedy query

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?

Reply With Quote
  #2 (permalink)  
Old 12-14-2006
Manish Pandit
 
Posts: n/a
Default Re: Help with greedy query


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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 03:03 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0