Updating ultrasphinx index after save?


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 :slight_smile: . Is there a better way to this? Maby with the delta index?


If you really need index updates to happen when a record is updated, you should use Solr.

Thanks Maurício,

Ok, I'll also give it a shot :slight_smile: ... Damn, I've now tried Ferret - Ultrasphinx ... and now Solr :slight_smile: . Madness. Actually I kind of liked Ultrasphinx.