diff --git a/pandora/document/fulltext.py b/pandora/document/fulltext.py index 6779113c..d64cd258 100644 --- a/pandora/document/fulltext.py +++ b/pandora/document/fulltext.py @@ -36,13 +36,12 @@ 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() diff --git a/pandora/document/models.py b/pandora/document/models.py index c938c260..0c61f019 100644 --- a/pandora/document/models.py +++ b/pandora/document/models.py @@ -653,7 +653,6 @@ def delete_document(sender, **kwargs): if t.file: t.delete_cache() t.file.delete(save=False) - t.delete_fulltext() pre_delete.connect(delete_document, sender=Document) class ItemProperties(models.Model): diff --git a/static/js/findDocumentsElement.js b/static/js/findDocumentsElement.js index 4f5dd464..ad7efcb1 100644 --- a/static/js/findDocumentsElement.js +++ b/static/js/findDocumentsElement.js @@ -33,7 +33,7 @@ pandora.ui.findDocumentsElement = function() { } }), ] : [], [ - pandora.$ui.findDocumentsSelect = $findSelect = Ox.Select({ + $findSelect = Ox.Select({ id: 'select', items: [].concat( pandora.site.documentKeys.filter(function(key) { @@ -70,7 +70,7 @@ pandora.ui.findDocumentsElement = function() { } } }), - pandora.$ui.findDocumentsInput = $findInput = Ox.Input({ + $findInput = Ox.Input({ autocomplete: autocompleteFunction(), autocompleteSelect: true, autocompleteSelectHighlight: true,