Hi, I opened this issue today:
I run a few more tests in the console, just to confirm the issue is not with my code. Everything gets updated and works as expected. The problem is that geo_code does not ever get updated on updates.
I think this is related to https://github.com/elastic/elasticsearch-rails/pull/182 (trying to understand how this works exactly myself...)
@keferboeck i had the same situation, so i found one possible solution:
The idea is after update your object with save or update_attributes method, force index again, like:
model_object.__elasticsearch__.index_document
@eduzera indeed, my own solution is to add this as a callback after any update:
# mobel.rb
after_commit on: [:update] do
__elasticsearch__.index_document
end
so it re-indexes the entire object. Ideally we would have a solution like proposed in #182 that handles "partial updates" correctly even for derived attributes.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.