Open mmeys opened 11 years ago
1.) Updating the index only when the indexed fields changed would be duplicate of Issue #11 2.) Removing this line would prevent objects from being deleted from the index when they are updated. Which is likely a use case.
For your problem, perhaps look into using a when block that returns false on update if the fields haven't changed. Perhaps using http://stackoverflow.com/questions/1586536/how-to-detect-attribute-changes-from-model
1.) I agree. 2.) Indeed. I don't understand why this has never been corrected.
Thanks for the suggestion, that's what I did!
Hi,
I was wondering why an ActiveRecord object indexed using the
asari_index
method is removed from cloud search after and update if it doesn't match theasari_should_index?
method?The behavior I want is to update on cloud search the indexed object only when some attributes changed. Indeed I index users of my app with their name and their avatar. So I don't want to update them on cloud search if theses attributes doesn't change...and I don't want them to be deleted from cloud search neither.
That's why I suggest to remove the
self.asari_remove_item(obj)
line from theasari_update_item
method.