Updating ultrasphinx index after save?

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

Thanks

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 P.
[email protected] wrote:

def update
require ‘rake/rdoctask’


Maurício Linhares
http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/
(en)
João Pessoa, PB, +55 83 8867-7208

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.