Hi all, I''m trying to set up Ferret with the acts_as_ferret plugin and have run into some problems. I''m using a very basic setup as recommended by all the tutorials: install the ferret gem and acts_as_ferret plugin, put the line acts_as_ferret in my User class, then do something like this in my controller: @users = User.find_with_ferret(params[:query]) This returns no results. The log shows no errors, just something like: Query: test total hits: 0, results delivered: 0 No results are found for any query. I''ve tried deleting the Index directory and restarting the server, but this doesn''t help. I wonder if this is related to the fact that much of the documentation seems to be out of date - almost all tutorials refer to find_by_contents, which I believe has been replaced by find_with_ferret. Also, I installed the acts_as_ferret gem and ran aaf_install - could this have caused problems? Has anyone successfully got this to work? Many thanks, Adam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It works fine for me. maybe force a rebuild index in script/console: Model.rebuild_index and use @object.ferret_update whenever you change something in a field that''s ferret indexed. otherwise have a look at acts_at_ferret.log in the log folder... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the quick reply. There''s definately a problem with the indexing. In acts_as_ferret.log I''m repeatedly getting [user] register class User with index user [user] refusing re-registration of class User Also, in the index directory, the file segments is empty, and segments_0 contains only the line class_name? I tried using User.rebuild_index from the console and it did appear to build an index - there are now files called segments_oj and _oi.cfs in the index directory which are not empty. However, User.find_by_ferret still returns no results. I''m pretty stumped! On 18 Jun, 12:56, Thorsten Müller <thors...-1oxKqHKwyltBDgjK7y7TUQ@public.gmane.org> wrote:> It works fine for me. > maybe force a rebuild index in script/console: > Model.rebuild_index > > and use @object.ferret_update whenever you change something in a field > that''s ferret indexed. > > otherwise have a look at acts_at_ferret.log in the log folder...--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I don''t have much of an idea, since it worked for me easy enough. maybe you didn''t set it up properly? acts_as_ferret :fields => {:name => {:boost => 3}, :description => {:boost => 2, :store => :no}, :tag_list => {}}, :index_dir => File.join(RAILS_ROOT, "public", "index") this one is adding fields name and description plus the tag_list (from acts_as_taggable) but as you see, it''s not doing much. the boos values are optional anyway --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Fixed! Looks like it was just a dodgy installation. I was using the plugin installer built in to Aptana Radrails, which I guess must be corrupt. When I removed it and did a manual install it worked fine. Thanks for your help :) On 18 Jun, 13:32, Thorsten Müller <thors...-1oxKqHKwyltBDgjK7y7TUQ@public.gmane.org> wrote:> I don''t have much of an idea, since it worked for me easy enough. > maybe you didn''t set it up properly? > > acts_as_ferret :fields => {:name => {:boost => 3}, :description => > {:boost => 2, :store => :no}, :tag_list => {}}, > :index_dir => File.join(RAILS_ROOT, "public", > "index") > > this one is adding fields name and description > plus the tag_list (from acts_as_taggable) > but as you see, it''s not doing much. the boos values are optional > anyway--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---