Hi, I''m trying out Ultrasphinx instead of ferret. Unfortunately it seems not to be possible to update the index (in an efficient way) after creating or updating a record. I managed to run the update index rake task, but that''s not a good option. Here is what I tried: def update @user = User.find params[:id] @user.language = $activelanguage @user.add_usercategories params[:selectedusercategories] if params[:selectedusercategories] @user.updated_at = Time.now respond_to do |format| if @user.update_attributes(params[:user]) require ''rake'' require ''rake/testtask'' require ''rake/rdoctask'' require ''tasks/rails'' Rake::Task["ultrasphinx:index:main"].invoke ... end = BAD :) . Is there a better way to this? Maby with the delta index? Thanks -- 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-/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 -~----------~----~----~----~------~----~------~--~---
If you really need index updates to happen when a record is updated, you should use Solr. On Thu, Sep 25, 2008 at 2:01 PM, Maarten Porters <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi, > > I''m trying out Ultrasphinx instead of ferret. Unfortunately it seems not > to be possible to update the index (in an efficient way) after creating > or updating a record. I managed to run the update index rake task, but > that''s not a good option. > > Here is what I tried: > > def update > @user = User.find params[:id] > @user.language = $activelanguage > @user.add_usercategories params[:selectedusercategories] if > params[:selectedusercategories] > @user.updated_at = Time.now > > respond_to do |format| > if @user.update_attributes(params[:user]) > require ''rake'' > require ''rake/testtask'' > require ''rake/rdoctask'' > require ''tasks/rails'' > Rake::Task["ultrasphinx:index:main"].invoke > ... > end > > = BAD :) . Is there a better way to this? Maby with the delta index? > > Thanks > -- > Posted via http://www.ruby-forum.com/. > > > >-- Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) João Pessoa, PB, +55 83 8867-7208 --~--~---------~--~----~------------~-------~--~----~ 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 Maurício, Ok, I''ll also give it a shot :) ... Damn, I''ve now tried Ferret - Ultrasphinx ... and now Solr :) . Madness. Actually I kind of liked Ultrasphinx. -- 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-/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 -~----------~----~----~----~------~----~------~--~---