remove documents from index
This commit is contained in:
parent
823b8f2136
commit
2889c15dc8
2 changed files with 5 additions and 3 deletions
|
|
@ -36,12 +36,13 @@ class FulltextMixin:
|
|||
return self.data.get('text', '')
|
||||
return ''
|
||||
|
||||
def delete_fulltext(self):
|
||||
res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type='document', id=self.id)
|
||||
|
||||
def has_fulltext_key():
|
||||
return bool([k for k in settings.CONFIG['documentKeys'] if k.get('fulltext')])
|
||||
|
||||
def delete_fulltext(self):
|
||||
if self.has_fulltext_key():
|
||||
res = self.elasticsearch().delete(index=self._ES_INDEX, doc_type='document', id=self.id)
|
||||
|
||||
def update_fulltext(self):
|
||||
if self.has_fulltext_key():
|
||||
text = self.extract_fulltext()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue