You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
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 the asari_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 the asari_update_item method.
def asari_update_item(obj)
if self.asari_when
unless asari_should_index?(obj)
self.asari_remove_item(obj) # I suggest to remove this line
return
end
end
data = {}
self.asari_fields.each do |field|
data[field] = obj.send(field)
end
self.asari_instance.update_item(obj.send(:id), data)
rescue Asari::DocumentUpdateException => e
self.asari_on_error(e)
end
The text was updated successfully, but these errors were encountered:
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.
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.The text was updated successfully, but these errors were encountered: