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.
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.
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.