From ead29304bcd50128ffdece2075c27fbb54709a65 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 2 Dec 2019 21:29:14 +0100 Subject: [PATCH] document might already be gone --- pandora/document/fulltext.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora/document/fulltext.py b/pandora/document/fulltext.py index e3e665cca..b383e8dfd 100644 --- a/pandora/document/fulltext.py +++ b/pandora/document/fulltext.py @@ -41,7 +41,11 @@ class FulltextMixin: def delete_fulltext(self): if self.has_fulltext_key(): - res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type='document', id=self.id) + from elasticsearch.exceptions import NotFoundError + try: + res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type='document', id=self.id) + except NotFoundError: + pass def update_fulltext(self): if self.has_fulltext_key():