Elasticsearch: update_document irrelevant
update_document method. However in the normal circumstances it is bypassed, and ultimately triggers
This is because we trigger indexing asynchronously, but
update_document would only do a proper
update operation when the attribute changes are stored in the
@__changed_model_attributes instance variable (this is setup by elasticsearch-rails' before_save callback).
Note indexing would still be done properly, because as passing the whole document to elasticsearch for indexing is perfectly valid.
We can either:
- Update its only caller
IndexRecordServiceto always call
- Pass changed attributes when asynchronously schedule indexing
Remove unused code so is easier to understand.