Topic: live search with more than one word?

So I've created a live search page for this site.  Here's the controller code:

def search_ajax
   
    @issues = Issue.find( :all,
      :conditions => [ "keywords LIKE ?",
         "%#{params[:issue][:keywords]}%" ] )
    render :layout=>false
  end

If I have keywords listed under one record as:

apple bat cat rat

If I type in any of those words on its own, the result comes up.  If I type in any of the words in the order they appear, like "bat cat" for instance, it appears.  BUT, if I type in "rat apple" then nothing appears.  Any way that I can have the search just find the words rather than as if it was a phrase?

Re: live search with more than one word?

You're better off using a dedicated search index/engine like Ferret to do this sort of thing. Search for "acts_as_ferret" for some docs/examples.

vinnie - rails forum admin