View Single Post

   
  #3 (permalink)  
Old 05-05-2008, 05:51 AM
Paul Lautman
 
Posts: n/a
Default Re: Is there a way to do this?

matt wrote:
>I am trying to write a video search engine for my website which has a
> database of videos that stores the following information (among other
> things): "Title", "Keywords", and "Description".
>
> The goal of this search engine is to have a user type in a query and
> then have it return results where any of those fields match using the
> 'LIKE' command. However, I want all of the videos with titles matching
> to be shown before those with keywords matching, and then the ones
> with description matching.
>
> Obviously this can be done with 3 commands but based on my current
> configuration it would be REALLY nice if I could do it with one result
> set. For example, pagination. If I want to limit results to 10 per
> page it is difficult to use the LIMIT command over 3 different sql
> statements.
>
> I was thinking something with GROUP maybe?? But I feel like that can
> only be done over fields. Any thoughts??


I think you're actually looking for FULLTEXT searching.


Reply With Quote