forked from 0x2620/pandora
document might already be gone
This commit is contained in:
parent
1d9e43b551
commit
ead29304bc
1 changed files with 5 additions and 1 deletions
|
@ -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():
|
||||||
|
|
Loading…
Reference in a new issue