On Thu, Mar 29, 2007 at 02:59:04PM +0200, P. Schrammel wrote:
> Now it works...don't ask why. I'll try to explain what I did, perhaps
> you'll find the error:

yeah, delete_all is evil because it only does the sql delete without
calling the Rails callback methods for the deleted records - so there's
no way for aaf to remove the old entries from the index. destroy_all
would have worked. By deleting the index directory you forced aaf to
rebuild the index, which then used the new aaf-options.

Long story short: Calling Article.rebuild_index after changing the aaf
options would have worked, too :-)

Jens


> 
> Created a rails model:
> 
> class Article < ActiveRecord::Base
>   acts_as_ferret :fields => [:normalized_text],
>     :analyzer => HTMLAnalyzer.new
> end
> 
> -filled in the data. Found docs that I should use :store
> -called Article.delete_all on the rails console
> -rewrote article.rb :
> 
> class Article < ActiveRecord::Base
>   acts_as_ferret :fields => { :normalized_text => {:store => :yes }},
>     :analyzer => HTMLAnalyzer.new
> end
> 
> -fill in the data (highlight didn't work)
> -did Article.delete_all again
> -rm RAILS_ROOT/index/article/*
> -fill in the data
> -highlight works
> 
> Thanks
> Peter
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Ferret-talk mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/ferret-talk
> 

-- 
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
 
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to