I got it working but in a very strange way.

If I deleted the index directory and AAF recreated it automatically on 
the first search my search did not work.
BUT if I do Model.rebuild_index to rebuild the index my search DOES 
work.




Izit Izit wrote:
> Hi,
> 
> I have configured my model as follows:
> 
> class Product < ActiveRecord::Base
> 
>   acts_as_ferret :fields =>
> [:description,:label_description,:label_free,:product_id_supplier,:description_supplier,:supplier_description]
> 
>   belongs_to :supplier
> 
> 
>   def supplier_description
>     return "#{self.supplier.description}"
>   end
> 
> In the development log I can see the supplier_description being added to
> the index:
> 
> creating doc for class: Product, id: 24710306
> Adding field label_free with value '67CM' to index
> Adding field product_id_supplier with value '177-175-078 middel' to
> index
>   Supplier Load (0.000359)   SELECT * FROM suppliers WHERE
> (suppliers.`id` = 19)
> Adding field supplier_description with value 'Haans' to index
> Adding field description with value 'MAND RATTAN MIDDEL 67CM' to index
> Adding field description_supplier with value '' to index
> Adding field label_description with value 'MAND RATTAN MIDDEL' to index
> 
> 
> But when I do a Product.find_by_contents("Haans") I get nothing back.
> 
> => #<ActsAsFerret::SearchResults:0x3514b88 @total_hits=0, @results=[]>
> 
> The development log shows:
> 
> Query: Haans
> total hits: 0, results delivered: 0
> 
> Does anybody know why my association does not work. Other searches on
> fields in the Product model work fine.

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to