Forum: Ferret acts_as_ferret: experiencing bugs with very simple search

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tony A. (Guest)
on 2009-04-14 08:25
I am doing a very simple search on my DB using acts_as_ferret. I put
this in my "Venue" model:

   acts_as_ferret :fields => [:name, :city]

And this is in my controller search action:

   @t = Venue.find_by_contents(params[:search]+'~')

and then I just render the results.

   render :text => @t.to_json, :success => true, :status => :ok

If I run a quick test:

   http://localhost:3000/venue/list?search=The

I see in my log that the proper query "The~" is being executed on the
index. However, I get no results. I definitely have a few "Venues" with
the word "The" in the name field.

Since this is a very simple search and acts_as_ferret is used quite a
bit, I tried rebuilding the index to see if it was corrupted....no dice

Any ideas?

Thanks!
This topic is locked and can not be replied to.