Hi All, I want to implement full text searching in my rails 3.0 application, i am using acts_as_ferret gem for that. i installed acts_as_ferret gem. Installed gems list: ===================acts_as_ferret (0.5.2) jk-ferret (0.11.8.2) rails (3.0.1) will_paginate (3.0.pre2) And i followed these step, for try in ubuntu environment.... run: "rails new test -d mysql" #added the gem acts_as_ferret in Gemfile run: "bundle install" It also completed properly, i saw the acts_as_ferret gem that list I created scaffold for user it creates the basic CRUD for ''user'' And i started the server, it was running properly. I added some data to database I added the code like below in my application Model ====class User < ActiveRecord::Base acts_as_ferret end Controller: =========@result = User.find_with_ferret(''jak'') If i tried (inspect) to get the result it returns empty Array object. Note: i have the data in database feilds like search text(jak), When i try this same approach in rails version 2.1.1 it is working fine! 1. Please suggest or help me address my mistake in above work ? 2. Is there any other way to implement full text search as fast as like ferret ? 3. Is it problem with acts_as_ferret in rails 3 ? Thanks in Advance, Jak -- Posted via http://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I think you have to specify which fields ferret will index. Take a look at: https://github.com/jkraemer/acts_as_ferret (under "Usage"). I got a lot of problems with ferret under production, you may consider switching to sphinx/thinking sphinx. On 27 Nov, 07:00, Arun Kumar <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi All, > I want to implement full text searching in my rails 3.0 application, i > am using acts_as_ferret gem for that. i installed acts_as_ferret gem. > > Installed gems list: > ===================> acts_as_ferret (0.5.2) > jk-ferret (0.11.8.2) > rails (3.0.1) > will_paginate (3.0.pre2) > > And i followed these step, for try in ubuntu environment.... > > run: "rails new test -d mysql" > #added the gem acts_as_ferret in Gemfile > run: "bundle install" > It also completed properly, i saw the acts_as_ferret gem that list > I created scaffold for user it creates the basic CRUD for ''user'' > And i started the server, it was running properly. > I added some data to database > > I added the code like below in my application > > Model > ====> class User < ActiveRecord::Base > acts_as_ferret > end > > Controller: > =========> @result = User.find_with_ferret(''jak'') > > If i tried (inspect) to get the result it returns empty Array object. > > Note: i have the data in database feilds like search text(jak), When i > try this same approach in rails version 2.1.1 it is working fine! > > 1. Please suggest or help me address my mistake in above work ? > 2. Is there any other way to implement full text search as fast as like > ferret ? > 3. Is it problem with acts_as_ferret in rails 3 ? > > Thanks in Advance, > Jak > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Arun Kumar
2010-Dec-01 07:10 UTC
Re: Acts_as_ferret is not indexing either locally or remote
eugenio wrote in post #964246:> I think you have to specify which fields ferret will index. Take a > look at: https://github.com/jkraemer/acts_as_ferret (under "Usage"). > I got a lot of problems with ferret under production, you may consider > switching to sphinx/thinking sphinx.Hi thanks for the reply i tried sphinx, but i have following issue. I am using rails 3.0 and i installed sphinx and added the following to gemfile gem ''thinking-sphinx'', ''2.0.0'', :require => ''thinking_sphinx'' My structure is like below: ========================= Model: ==== class User < ActiveRecord::Base include ActionView::Helpers::UrlHelper has_one :profile, :class_name => "UserProfile", :dependent => :destroy has_many :game_attributes, :dependent => :destroy do def game(user, gme,dt) find(:all, :conditions => {:user_id => user.id, :game_id => gme.id, :date => dt}) end end has_and_belongs_to_many :interested_game, :class_name => ''Game'', :join_table => ''interested_game_users'', :order => ''name'' define_index do indexes login indexes email indexes admin indexes staff indexes game_attributes(:name), :as => :ga_name indexes game_attributes.value, :as => :ga_value indexes profile.gender, :as => :up_gender has :id, created_at end end Controller: ========== Working query: ============"rake ts:in RAILS_ENV=development rake thinking_sphinx:rebuild RAILS_ENV=development rake ts:start RAILS_ENV=development rake ts:stop RAILS_ENV=development" are working fine... When i put this query " @results = User.search '''', :page => params[:page], :per_page => 10 " in controller, it producing the query, i can able to see the results. [1m[36mUser Load (0.1ms)[0m [1mSELECT `users`.* FROM `users` WHERE (`users`.`id` IN (272, 275, 280, 281, 282, 283, 288, 289, 290, 291))[0m @results [#<User #.............................................................">] ==============ThinkingSphinx::Search= length==== 10 When i try the below query it will not generate result or produces empty result...... When i try this same query with rails db console it producing the data, so we sure that have the data... please help me on this. query: ===== @results = User.search ''j'', :page => params[:page], :per_page => 10, :conditions => {:ga_gender =>''Female'', :login => ''Someusename'', :ga_name=> ''some name'', ga_value=>''some value''}, star =>true, :sort_mode => :extended, :order => "created_at DESC" 2. How to implement delta to update thinkg-sphinx automatically for some period / any document/forums , etc.. Thanks in Advance, Jak. -- Posted via http://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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.