I am struggling with a Tire issue.
In my Model, I added in the mapping:
indexes :localized_title, :as => "localized_title"
and the function that returns the hash of translations
def localized_title
hash = {}
translations.each do |t|
hash[t.locale] = t.title
end
hash
end
When I create a record of this model, even though the record is created in the database, it is not indexed
>Model.search{query{all}}.total
=> 0
But, if I update the index manually, it is indexed.
>Model.last.update_index
>Model.search{query{all}}.total
=> 1
An after_save update_index does not help. Any ideas ?
I would like the record to be automatically indexed, how can I do it ?