Hi, I think there is a bug in the update_document code. When changes to fields are saved in the @__changed_model_attributes attribute in the before_save callback, these are never cleared and can just grow until they contain all fields and the desired effect of using update_document is lost as it will no longer be performing partial updates.
This is all good, desired behaviour. The title is updated and only that field is indexed. However when we then go on to update more fields we find this:
We can see this retains the title field which has already been updated in the index. Should there be a way of clearing the @__changed_model_attributes attribute whenever documents are reindexed in any way?
Hi, I think there is a bug in the update_document code. When changes to fields are saved in the
@__changed_model_attributes
attribute in thebefore_save
callback, these are never cleared and can just grow until they contain all fields and the desired effect of usingupdate_document
is lost as it will no longer be performing partial updates.A replication of the bug:
This is all good, desired behaviour. The title is updated and only that field is indexed. However when we then go on to update more fields we find this:
We can see this retains the
title
field which has already been updated in the index. Should there be a way of clearing the@__changed_model_attributes
attribute whenever documents are reindexed in any way?