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
<[EMAIL PROTECTED]> 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 [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
-~----------~----~----~----~------~----~------~--~---

Reply via email to