document might already be gone

This commit is contained in:
j 2019-12-02 21:29:14 +01:00
parent 1d9e43b551
commit ead29304bc

View file

@ -41,7 +41,11 @@ class FulltextMixin:
def delete_fulltext(self): def delete_fulltext(self):
if self.has_fulltext_key(): if self.has_fulltext_key():
from elasticsearch.exceptions import NotFoundError
try:
res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type='document', id=self.id) res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type='document', id=self.id)
except NotFoundError:
pass
def update_fulltext(self): def update_fulltext(self):
if self.has_fulltext_key(): if self.has_fulltext_key():