An error occurred while fetching the assigned iteration of the selected issue.
Elasticsearch: update_document irrelevant
Summary
We override update_document
method. However in the normal circumstances it is bypassed, and ultimately triggers index_document
instead.
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
IndexRecordService
to always callindex_document
instead. - Pass changed attributes when asynchronously schedule indexing
Improvements
Remove unused code so is easier to understand.
Risks
N/A