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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---