Hi!

I faced some issue while using it for dynamic attrs indexing/search.
Maybe I made something wrong. Here is test method. Everything works just
fine until last line http://pastie.caboo.se/66274 . Tested on both
stable and trunk of aaf and ferret 0.11.4.

the short version of code below:

   Contact.acts_as_ferret :fields => [ :first_name ]
   assert Contact.find(:first).respond_to?(:first_name_to_ferret)

   assert_equal 1, Contact.find_by_contents('Y*').total_hits
   assert_equal 1, Contact.find_by_contents('first_name:Y*').total_hits

   Contact.aaf_index.close
   FileUtils.rm_rf 'index'

   Contact.acts_as_ferret :fields => [ :first_name, :last_name ]
   assert Contact.find(:first).respond_to?(:last_name_to_ferret)

   assert_equal 1, Contact.find_by_contents('Y*').total_hits
   assert_equal 1, Contact.find_by_contents('first_name:Y*').total_hits

   assert_equal 1, Contact.find_by_contents('last_name:K*').total_hits
   assert_equal 1, Contact.find_by_contents('K*').total_hits # assertion
fails here: get 0 instead of 1 !!

Maybe there is any better solution to add new fields to existing index?


-- 

Best regards,
Yury Kotlyarov
<;-) BrainHouse

web: http://www.brainhouse.ru
email: [EMAIL PROTECTED]


_______________________________________________
Ferret-talk mailing list
Ferret-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to