Hi there, I’ve tried to implement ferret into my web application which would be used to search the various models and return results based on the word entered. I cant get this to work, and wondered if anyone uses any other searchable plugin for Ruby on Rails, and if so, what was best? I don''t need anything specifically fancy – but something that at least returns me some results. Any Ideas? If anyone has had success using ferret – please check out: http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/thread/683e0888c1c6a8cb And see if you can help me out…. Cheers
use acts as ferret On Tue, Oct 27, 2009 at 3:42 PM, RubyonRails_newbie < craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Hi there, > > I’ve tried to implement ferret into my web application which would be > used to search the various models and return results based on the word > entered. > > I cant get this to work, and wondered if anyone uses any other > searchable plugin for Ruby on Rails, and if so, what was best? > > I don''t need anything specifically fancy – but something that at least > returns me some results. > > Any Ideas? > > If anyone has had success using ferret – please check out: > > http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/thread/683e0888c1c6a8cb > > And see if you can help me out…. > > Cheers > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
thanks I have done that and it doesn''t work. Nothing is returned. see my ferret post On 27 Oct, 10:30, sanjib dhar <sanjibdhar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> use acts as ferret > > On Tue, Oct 27, 2009 at 3:42 PM, RubyonRails_newbie < > > > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > Hi there, > > > I’ve tried to implement ferret into my web application which would be > > used to search the various models and return results based on the word > > entered. > > > I cant get this to work, and wondered if anyone uses any other > > searchable plugin for Ruby on Rails, and if so, what was best? > > > I don''t need anything specifically fancy – but something that at least > > returns me some results. > > > Any Ideas? > > > If anyone has had success using ferret – please check out: > > >http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/threa... > > > And see if you can help me out…. > > > Cheers- Hide quoted text - > > - Show quoted text -
u did not configured it properly. On Tue, Oct 27, 2009 at 4:01 PM, RubyonRails_newbie < craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > thanks > > I have done that and it doesn''t work. Nothing is returned. > > see my ferret post > > On 27 Oct, 10:30, sanjib dhar <sanjibdhar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > use acts as ferret > > > > On Tue, Oct 27, 2009 at 3:42 PM, RubyonRails_newbie < > > > > > > > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > > Hi there, > > > > > I’ve tried to implement ferret into my web application which would be > > > used to search the various models and return results based on the word > > > entered. > > > > > I cant get this to work, and wondered if anyone uses any other > > > searchable plugin for Ruby on Rails, and if so, what was best? > > > > > I don''t need anything specifically fancy – but something that at least > > > returns me some results. > > > > > Any Ideas? > > > > > If anyone has had success using ferret – please check out: > > > > >http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/threa. > .. > > > > > And see if you can help me out…. > > > > > Cheers- Hide quoted text - > > > > - Show quoted text - > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
We r using it for a decade!!!!!!!!!! On Tue, Oct 27, 2009 at 4:00 PM, sanjib dhar <sanjibdhar222-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> use acts as ferret > > > On Tue, Oct 27, 2009 at 3:42 PM, RubyonRails_newbie < > craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> >> Hi there, >> >> I’ve tried to implement ferret into my web application which would be >> used to search the various models and return results based on the word >> entered. >> >> I cant get this to work, and wondered if anyone uses any other >> searchable plugin for Ruby on Rails, and if so, what was best? >> >> I don''t need anything specifically fancy – but something that at least >> returns me some results. >> >> Any Ideas? >> >> If anyone has had success using ferret – please check out: >> >> http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/thread/683e0888c1c6a8cb >> >> And see if you can help me out…. >> >> Cheers >> >> >> >> >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
what have I missed? I''m new to ruby on rails, and followed the tutorial to set it up.. What other config do I need??? On 27 Oct, 10:35, sanjib dhar <sanjibdhar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> We r using it for a decade!!!!!!!!!! > > On Tue, Oct 27, 2009 at 4:00 PM, sanjib dhar <sanjibdhar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > > > > > use acts as ferret > > > On Tue, Oct 27, 2009 at 3:42 PM, RubyonRails_newbie < > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > >> Hi there, > > >> I’ve tried to implement ferret into my web application which would be > >> used to search the various models and return results based on the word > >> entered. > > >> I cant get this to work, and wondered if anyone uses any other > >> searchable plugin for Ruby on Rails, and if so, what was best? > > >> I don''t need anything specifically fancy – but something that at least > >> returns me some results. > > >> Any Ideas? > > >> If anyone has had success using ferret – please check out: > > >>http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/threa... > > >> And see if you can help me out…. > > >> Cheers- Hide quoted text - > > - Show quoted text -
IN model...user.rb. acts_as_ferret({:fields => {:get_text_for_fields_to_index => {}}}) def get_text_for_fields_to_index [self.first_name, self.last_name, self.login, self.email, self.basic_profile.about_me, self.basic_profile.city, self.basic_profile.state, self.basic_profile.country, self.personal_profile.activities, self.personal_profile.interests, self.personal_profile.movies, self.personal_profile.music, self.personal_profile.tv, self.personal_profile.turn_ons, self.personal_profile.turn_offs ].join(" ").strip end Inside controller.. def search @query = params[:query].to_s.strip conditions = ["users.is_test = ? and users.user_type != ?", false, User::ANONYMOUS] @users = User.find_with_ferret(@query, {:per_page => @@items_per_page, :page => params[:page]}, :conditions => conditions) @total = @users.total_hits @page_title = "Searched users for ''#{@query}'' - fStation" @meta_desc = "Searched users for #{@query} - " + @users.collect(&:display_fullname).join('','') render "jokes/search" end On Tue, Oct 27, 2009 at 4:06 PM, RubyonRails_newbie < craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > what have I missed? > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > What other config do I need??? > > On 27 Oct, 10:35, sanjib dhar <sanjibdhar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > We r using it for a decade!!!!!!!!!! > > > > On Tue, Oct 27, 2009 at 4:00 PM, sanjib dhar <sanjibdhar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > >wrote: > > > > > > > > > use acts as ferret > > > > > On Tue, Oct 27, 2009 at 3:42 PM, RubyonRails_newbie < > > > craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > >> Hi there, > > > > >> I’ve tried to implement ferret into my web application which would be > > >> used to search the various models and return results based on the word > > >> entered. > > > > >> I cant get this to work, and wondered if anyone uses any other > > >> searchable plugin for Ruby on Rails, and if so, what was best? > > > > >> I don''t need anything specifically fancy – but something that at least > > >> returns me some results. > > > > >> Any Ideas? > > > > >> If anyone has had success using ferret – please check out: > > > > >>http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/threa. > .. > > > > >> And see if you can help me out…. > > > > >> Cheers- Hide quoted text - > > > > - Show quoted text - > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
RubyonRails_newbie wrote:> what have I missed? > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > What other config do I need???How should we know, without any info on what errors you''re getting? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
There are no errors On 27 Oct, 16:34, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> RubyonRails_newbie wrote: > > what have I missed? > > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > > What other config do I need??? > > How should we know, without any info on what errors you''re getting? > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
Ah actually, in Terminal there is this: configured index for class Info: {:ferret_fields=>{"username"=> {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, :via=>"username", :store=>:no, :index=>:yes}, "email"=> {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, :via=>"email", :store=>:no, :index=>:yes}}, :user_default_field=>nil, :enabled=>true, :fields=> ["username", "email"], :index_dir=>"/Users/me/apps/ruby/project_test/ index/development/ info", :mysql_fast_batches=>true, :single_index=>false, :index_base_dir=>"/ Users/me/apps/ruby/project_test/index/development/ info", :name=>:info, :reindex_batch_size=>1000, :raise_drb_errors=>false, :registered_models=> [Info(id: integer, user_id: integer, first_name: string, last_name: string, gender: string, birthdate: date, city: string, ski_snowboard: string)], :ferret=>{:default_field=>["username", "email"], :path=>"/ Users/me/apps/ruby/project_test/index/development/ info", :analyzer=>#<Ferret::Analysis::StandardAnalyzer: 0x26db044>, :lock_retry_time=>2, :auto_flush=>true, :or_default=>false, :key=>:key, :dir=>#<Ferret::Store::FSDirectory: 0x26c8d04>, :handle_parse_errors=>true, :create_if_missing=>true}} But I don''t get why it isnt returning anything On 27 Oct, 16:34, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> RubyonRails_newbie wrote: > > what have I missed? > > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > > What other config do I need??? > > How should we know, without any info on what errors you''re getting? > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
I have found a log file if it helps... It doesn''t mean a lot to me though... Query: username1 total hits: 0, results delivered: 0 [user] register class User with index user [user] refusing re-registration of class User index_for [User(id: integer, username: string, email: string, password: string, created_at: datetime, updated_at: datetime, authorization_token: string)] options: {:page=>nil, :offset=>0, :limit=>:all} ar_options: {} [user] stored_fields: nil On 27 Oct, 18:21, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Ah actually, in Terminal there is this: > > configured index for class Info: > {:ferret_fields=>{"username"=> > {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, :via=>"username", :store=>:no, :index=>:yes}, > "email"=> > {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, :via=>"email", :store=>:no, :index=>:yes}}, :user_default_field=>nil, :enabled=>true, :fields=> > ["username", "email"], :index_dir=>"/Users/me/apps/ruby/project_test/ > index/development/ > info", :mysql_fast_batches=>true, :single_index=>false, :index_base_dir=>"/ > Users/me/apps/ruby/project_test/index/development/ > info", :name=>:info, :reindex_batch_size=>1000, :raise_drb_errors=>false, :registered_models=> > [Info(id: integer, user_id: integer, first_name: string, last_name: > string, gender: string, birthdate: date, city: string, ski_snowboard: > string)], :ferret=>{:default_field=>["username", "email"], :path=>"/ > Users/me/apps/ruby/project_test/index/development/ > info", :analyzer=>#<Ferret::Analysis::StandardAnalyzer: > 0x26db044>, :lock_retry_time=>2, :auto_flush=>true, :or_default=>false, :key=>:key, :dir=>#<Ferret::Store::FSDirectory: > 0x26c8d04>, :handle_parse_errors=>true, :create_if_missing=>true}} > > But I don''t get why it isnt returning anything > > On 27 Oct, 16:34, Marnen Laibow-Koser <rails-mailing-l...@andreas- > > > > s.net> wrote: > > RubyonRails_newbie wrote: > > > what have I missed? > > > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > > > What other config do I need??? > > > How should we know, without any info on what errors you''re getting? > > > Best, > > -- > > Marnen Laibow-Koserhttp://www.marnen.org > > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > -- > > Posted viahttp://www.ruby-forum.com/.
RubyonRails_newbie
2009-Oct-27 21:18 UTC
** UPDATE** Adding SEARCH functionality to a website
Update: I seem to have some success in returning a value in the log, but it still isn''t displaying it in the browser.. the log shows total hits: 2, results delivered: 2 however, why is the data not displaying in the browser? Here''s how my controller looks so far: def search @title = " Search" if params[:q] query = params[:q] # First find the user hits... users = User.find_with_ferret(query, :limit => :all) @users = users.collect { |user| info.user } end so the log finds 2 records, but nothing visible to the user.. any ideas? On 27 Oct, 20:42, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> I have found a log file if it helps... > > It doesn''t mean a lot to me though... > > Query: username1 > total hits: 0, results delivered: 0 > [user] register class User with index user > [user] refusing re-registration of class User > index_for [User(id: integer, username: string, email: string, > password: string, created_at: datetime, updated_at: datetime, > authorization_token: string)] > options: {:page=>nil, :offset=>0, :limit=>:all} > ar_options: {} > [user] stored_fields: nil > > On 27 Oct, 18:21, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > > > > Ah actually, in Terminal there is this: > > > configured index for class Info: > > {:ferret_fields=>{"username"=> > > {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, :via=>"username", :store=>:no, :index=>:yes}, > > "email"=> > > {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, :via=>"email", :store=>:no, :index=>:yes}}, :user_default_field=>nil, :enabled=>true, :fields=> > > ["username", "email"], :index_dir=>"/Users/me/apps/ruby/project_test/ > > index/development/ > > info", :mysql_fast_batches=>true, :single_index=>false, :index_base_dir=>"/ > > Users/me/apps/ruby/project_test/index/development/ > > info", :name=>:info, :reindex_batch_size=>1000, :raise_drb_errors=>false, :registered_models=> > > [Info(id: integer, user_id: integer, first_name: string, last_name: > > string, gender: string, birthdate: date, city: string, ski_snowboard: > > string)], :ferret=>{:default_field=>["username", "email"], :path=>"/ > > Users/me/apps/ruby/project_test/index/development/ > > info", :analyzer=>#<Ferret::Analysis::StandardAnalyzer: > > 0x26db044>, :lock_retry_time=>2, :auto_flush=>true, :or_default=>false, :key=>:key, :dir=>#<Ferret::Store::FSDirectory: > > 0x26c8d04>, :handle_parse_errors=>true, :create_if_missing=>true}} > > > But I don''t get why it isnt returning anything > > > On 27 Oct, 16:34, Marnen Laibow-Koser <rails-mailing-l...@andreas- > > > s.net> wrote: > > > RubyonRails_newbie wrote: > > > > what have I missed? > > > > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > > > > What other config do I need??? > > > > How should we know, without any info on what errors you''re getting? > > > > Best, > > > -- > > > Marnen Laibow-Koserhttp://www.marnen.org > > > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > > -- > > > Posted viahttp://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Oct-27 21:22 UTC
Re: ** UPDATE** Adding SEARCH functionality to a website
RubyonRails_newbie wrote:> Update: I seem to have some success in returning a value in the log, > but it still isn''t displaying it in the browser.. > > the log shows > > total hits: 2, results delivered: 2 > > however, why is the data not displaying in the browser? > > Here''s how my controller looks so far: > > > def search > > @title = " Search" > if params[:q] > query = params[:q] > # First find the user hits... > > users = User.find_with_ferret(query, :limit => :all) > > @users = users.collect { |user| info.user }Did you mean user.info ?> > > end > > > so the log finds 2 records, but nothing visible to the user.. any > ideas? > > > On 27 Oct, 20:42, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
RubyonRails_newbie
2009-Oct-27 21:32 UTC
Re: ** UPDATE** Adding SEARCH functionality to a website
I''ve changed that too, and that hasn''t changed the end result.... The log definately shows the user, but nothing in the browser... what should i write to output the results? On 27 Oct, 21:22, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> RubyonRails_newbie wrote: > > Update: I seem to have some success in returning a value in the log, > > but it still isn''t displaying it in the browser.. > > > the log shows > > > total hits: 2, results delivered: 2 > > > however, why is the data not displaying in the browser? > > > Here''s how my controller looks so far: > > > def search > > > @title = " Search" > > if params[:q] > > query = params[:q] > > # First find the user hits... > > > users = User.find_with_ferret(query, :limit => :all) > > > @users = users.collect { |user| info.user } > > Did you mean user.info ? > > > end > > > so the log finds 2 records, but nothing visible to the user.. any > > ideas? > > > On 27 Oct, 20:42, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
what do you have in your views folders, specifically search.html or search.html.erb?
Marnen Laibow-Koser
2009-Oct-27 22:01 UTC
Re: ** UPDATE** Adding SEARCH functionality to a website
RubyonRails_newbie wrote:> I''ve changed that too, and that hasn''t changed the end result.... > > > The log definately shows the user, but nothing in the browser... > > what should i write to output the results?What does your view file look like?> > On 27 Oct, 21:22, Marnen Laibow-Koser <rails-mailing-l...@andreas-Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Andrew Pace
2009-Oct-28 03:26 UTC
Re: ** UPDATE** Adding SEARCH functionality to a website
I assume that you have tried this but if not it is worth a shot. If your model was filled with data prior to setting up ferret, then I don''t believe those rows will be indexed. You will need to build the index or rebuild it. If you have not added any new data to the database, you may very well have it all set up correctly but it will return nothing. Try Model.rebuild_index, if you haven''t and try the search function again. Also, it may be helpful to go to the script/ console to bypass your controllers and views to see what data is coming back. Just my thoughts. Andrew
Use sphinx instead of ferret pat allan has written a beautiful plugin to incorporate sphinx called thinking sphinx i would advice you to use sphinx . On 10/28/09, RubyonRails_newbie <craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > I have found a log file if it helps... > > It doesn''t mean a lot to me though... > > Query: username1 > total hits: 0, results delivered: 0 > [user] register class User with index user > [user] refusing re-registration of class User > index_for [User(id: integer, username: string, email: string, > password: string, created_at: datetime, updated_at: datetime, > authorization_token: string)] > options: {:page=>nil, :offset=>0, :limit=>:all} > ar_options: {} > [user] stored_fields: nil > > > On 27 Oct, 18:21, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: >> Ah actually, in Terminal there is this: >> >> configured index for class Info: >> {:ferret_fields=>{"username"=> >> {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, >> :via=>"username", :store=>:no, :index=>:yes}, >> "email"=> >> {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, >> :via=>"email", :store=>:no, :index=>:yes}}, :user_default_field=>nil, >> :enabled=>true, :fields=> >> ["username", "email"], :index_dir=>"/Users/me/apps/ruby/project_test/ >> index/development/ >> info", :mysql_fast_batches=>true, :single_index=>false, >> :index_base_dir=>"/ >> Users/me/apps/ruby/project_test/index/development/ >> info", :name=>:info, :reindex_batch_size=>1000, :raise_drb_errors=>false, >> :registered_models=> >> [Info(id: integer, user_id: integer, first_name: string, last_name: >> string, gender: string, birthdate: date, city: string, ski_snowboard: >> string)], :ferret=>{:default_field=>["username", "email"], :path=>"/ >> Users/me/apps/ruby/project_test/index/development/ >> info", :analyzer=>#<Ferret::Analysis::StandardAnalyzer: >> 0x26db044>, :lock_retry_time=>2, :auto_flush=>true, :or_default=>false, >> :key=>:key, :dir=>#<Ferret::Store::FSDirectory: >> 0x26c8d04>, :handle_parse_errors=>true, :create_if_missing=>true}} >> >> But I don''t get why it isnt returning anything >> >> On 27 Oct, 16:34, Marnen Laibow-Koser <rails-mailing-l...@andreas- >> >> >> >> s.net> wrote: >> > RubyonRails_newbie wrote: >> > > what have I missed? >> >> > > I''m new to ruby on rails, and followed the tutorial to set it up.. >> >> > > What other config do I need??? >> >> > How should we know, without any info on what errors you''re getting? >> >> > Best, >> > -- >> > Marnen Laibow-Koserhttp://www.marnen.org >> > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org >> > -- >> > Posted viahttp://www.ruby-forum.com/. > > >-- Krishnaprasad Varma
thanks for the comments - i will look into these, and if need be, try sphinx. On 28 Oct, 06:12, Krishnaprasad Varma <krishnaprasadva...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Use sphinx instead of ferret > pat allan has written a beautiful plugin to incorporate sphinx > called thinking sphinx > i would advice you to use sphinx . > > On 10/28/09, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > > > > > > > I have found a log file if it helps... > > > It doesn''t mean a lot to me though... > > > Query: username1 > > total hits: 0, results delivered: 0 > > [user] register class User with index user > > [user] refusing re-registration of class User > > index_for [User(id: integer, username: string, email: string, > > password: string, created_at: datetime, updated_at: datetime, > > authorization_token: string)] > > options: {:page=>nil, :offset=>0, :limit=>:all} > > ar_options: {} > > [user] stored_fields: nil > > > On 27 Oct, 18:21, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > >> Ah actually, in Terminal there is this: > > >> configured index for class Info: > >> {:ferret_fields=>{"username"=> > >> {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, > >> :via=>"username", :store=>:no, :index=>:yes}, > >> "email"=> > >> {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, > >> :via=>"email", :store=>:no, :index=>:yes}}, :user_default_field=>nil, > >> :enabled=>true, :fields=> > >> ["username", "email"], :index_dir=>"/Users/me/apps/ruby/project_test/ > >> index/development/ > >> info", :mysql_fast_batches=>true, :single_index=>false, > >> :index_base_dir=>"/ > >> Users/me/apps/ruby/project_test/index/development/ > >> info", :name=>:info, :reindex_batch_size=>1000, :raise_drb_errors=>false, > >> :registered_models=> > >> [Info(id: integer, user_id: integer, first_name: string, last_name: > >> string, gender: string, birthdate: date, city: string, ski_snowboard: > >> string)], :ferret=>{:default_field=>["username", "email"], :path=>"/ > >> Users/me/apps/ruby/project_test/index/development/ > >> info", :analyzer=>#<Ferret::Analysis::StandardAnalyzer: > >> 0x26db044>, :lock_retry_time=>2, :auto_flush=>true, :or_default=>false, > >> :key=>:key, :dir=>#<Ferret::Store::FSDirectory: > >> 0x26c8d04>, :handle_parse_errors=>true, :create_if_missing=>true}} > > >> But I don''t get why it isnt returning anything > > >> On 27 Oct, 16:34, Marnen Laibow-Koser <rails-mailing-l...@andreas- > > >> s.net> wrote: > >> > RubyonRails_newbie wrote: > >> > > what have I missed? > > >> > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > >> > > What other config do I need??? > > >> > How should we know, without any info on what errors you''re getting? > > >> > Best, > >> > -- > >> > Marnen Laibow-Koserhttp://www.marnen.org > >> > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > >> > -- > >> > Posted viahttp://www.ruby-forum.com/. > > -- > > Krishnaprasad Varma- Hide quoted text - > > - Show quoted text -
I''ve been developing Rails apps now for about three years and I was always mystified why there was no mainstream approach for running searches against my models. I didn''t like the ferret and sphinx approaches as they create MONSTER index files that have to be deleted from time to time with a CRON job. Instead, I stumbled upon a reasonably universal approach and have followed this for all projects. If you''re still in a quandry after you read this, send me an email and I''ll copy you some parts of my code that will explain it. Best of Luck, David On Oct 27, 4:12 am, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi there, > > I’ve tried to implement ferret into my web application which would be > used to search the various models and return results based on the word > entered. > > I cant get this to work, and wondered if anyone uses any other > searchable plugin for Ruby on Rails, and if so, what was best? > > I don''t need anything specifically fancy – but something that at least > returns me some results. > > Any Ideas? > > If anyone has had success using ferret – please check out:http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/threa... > > And see if you can help me out…. > > Cheers
InventoryTrackers wrote:> I''ve been developing Rails apps now for about three years and I was > always mystified why there was no mainstream approach for running > searches against my models. > I didn''t like the ferret and sphinx approaches as they create MONSTER > index files that have to be deleted from time to time with a CRON job. > Instead, I stumbled upon a reasonably universal approach and have > followed this for all projects. > If you''re still in a quandry after you read this, send me an email and > I''ll copy you some parts of my code that will explain it. > Best of Luck, > DavidOr just go to http://github.com/marnen/quorum2 and look at the Search class. (I''m not doing full-text searches yet, but adding them won''t be hard when I get around to it.)> > On Oct 27, 4:12�am, RubyonRails_newbie <craigwest...@googlemail.com>Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Are you talking about database searches? I''ve always built them myself, is that an option for you? On Tue, Oct 27, 2009 at 6:12 AM, RubyonRails_newbie < craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Hi there, > > I’ve tried to implement ferret into my web application which would be > used to search the various models and return results based on the word > entered. > > I cant get this to work, and wondered if anyone uses any other > searchable plugin for Ruby on Rails, and if so, what was best? > > I don''t need anything specifically fancy – but something that at least > returns me some results. > > Any Ideas? > > If anyone has had success using ferret – please check out: > > http://groups.google.co.uk/group/rubyonrails-talk/browse_thread/thread/683e0888c1c6a8cb > > And see if you can help me out…. > > Cheers > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Jillian Galloway
2009-Oct-29 18:20 UTC
Re: ** UPDATE** Adding SEARCH functionality to a website
Do you pass @users to the page correctly? Can you set breakpoints in you ide and confirm that @users actually has a list of hits? On Tue, Oct 27, 2009 at 5:18 PM, RubyonRails_newbie < craigwesty79-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Update: I seem to have some success in returning a value in the log, > but it still isn''t displaying it in the browser.. > > the log shows > > total hits: 2, results delivered: 2 > > however, why is the data not displaying in the browser? > > Here''s how my controller looks so far: > > > def search > > @title = " Search" > if params[:q] > query = params[:q] > # First find the user hits... > > users = User.find_with_ferret(query, :limit => :all) > > @users = users.collect { |user| info.user } > > > end > > > so the log finds 2 records, but nothing visible to the user.. any > ideas? > > > On 27 Oct, 20:42, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > I have found a log file if it helps... > > > > It doesn''t mean a lot to me though... > > > > Query: username1 > > total hits: 0, results delivered: 0 > > [user] register class User with index user > > [user] refusing re-registration of class User > > index_for [User(id: integer, username: string, email: string, > > password: string, created_at: datetime, updated_at: datetime, > > authorization_token: string)] > > options: {:page=>nil, :offset=>0, :limit=>:all} > > ar_options: {} > > [user] stored_fields: nil > > > > On 27 Oct, 18:21, RubyonRails_newbie <craigwest...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > > wrote: > > > > > > > > > Ah actually, in Terminal there is this: > > > > > configured index for class Info: > > > {:ferret_fields=>{"username"=> > > > {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, > :via=>"username", :store=>:no, :index=>:yes}, > > > "email"=> > > > {:term_vector=>:with_positions_offsets, :boost=>1.0, :highlight=>:yes, > :via=>"email", :store=>:no, :index=>:yes}}, :user_default_field=>nil, > :enabled=>true, :fields=> > > > ["username", "email"], :index_dir=>"/Users/me/apps/ruby/project_test/ > > > index/development/ > > > info", :mysql_fast_batches=>true, :single_index=>false, > :index_base_dir=>"/ > > > Users/me/apps/ruby/project_test/index/development/ > > > info", :name=>:info, :reindex_batch_size=>1000, > :raise_drb_errors=>false, :registered_models=> > > > [Info(id: integer, user_id: integer, first_name: string, last_name: > > > string, gender: string, birthdate: date, city: string, ski_snowboard: > > > string)], :ferret=>{:default_field=>["username", "email"], :path=>"/ > > > Users/me/apps/ruby/project_test/index/development/ > > > info", :analyzer=>#<Ferret::Analysis::StandardAnalyzer: > > > 0x26db044>, :lock_retry_time=>2, :auto_flush=>true, :or_default=>false, > :key=>:key, :dir=>#<Ferret::Store::FSDirectory: > > > 0x26c8d04>, :handle_parse_errors=>true, :create_if_missing=>true}} > > > > > But I don''t get why it isnt returning anything > > > > > On 27 Oct, 16:34, Marnen Laibow-Koser <rails-mailing-l...@andreas- > > > > > s.net> wrote: > > > > RubyonRails_newbie wrote: > > > > > what have I missed? > > > > > > > I''m new to ruby on rails, and followed the tutorial to set it up.. > > > > > > > What other config do I need??? > > > > > > How should we know, without any info on what errors you''re getting? > > > > > > Best, > > > > -- > > > > Marnen Laibow-Koserhttp://www.marnen.org > > > > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > > > -- > > > > Posted viahttp://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---