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
Is it possible to save an object, using the .save() and to pass an argument to not index in ES ?
I have a list of objects and how to index then using a bulk method to be more efficient than "saving" them one by one ?
I am searching for solution because I am importing a lot of data and doing .save() on each object but I can see that the indexation one by one is taking a lot of time.
For the first huge import I disabled ES in Django and at the end run the search_index --rebuild but then in a run mode it does not sound good to me. So I am searching another solution...
The text was updated successfully, but these errors were encountered:
For people who wants to do the same, this is what I found :
Override handle_save signals by passing a private value _auto_refresh in the Object:
def handle_save(self, sender, instance, **kwargs):
if hasattr(instance, '_auto_refresh') and instance._auto_refresh == False:
logger.debug("Do not update ElasticSearch for this object {}".format(instance.mykey))
else:
registry.update(instance)
registry.update_related(instance)
Hello,
Thanks for the job done here.
I have two questions:
I am searching for solution because I am importing a lot of data and doing .save() on each object but I can see that the indexation one by one is taking a lot of time.
For the first huge import I disabled ES in Django and at the end run the search_index --rebuild but then in a run mode it does not sound good to me. So I am searching another solution...
The text was updated successfully, but these errors were encountered: