kopia lustrzana https://github.com/wagtail/wagtail
Removed pyelasticsearch dependency
rodzic
104d5c9a64
commit
aea535f6d4
|
@ -1,7 +1,6 @@
|
|||
from django.db import models
|
||||
from django.conf import settings
|
||||
|
||||
from pyelasticsearch.exceptions import ElasticHttpNotFoundError
|
||||
from elasticutils import get_es, S
|
||||
|
||||
from wagtail.wagtailsearch.backends.base import BaseSearch
|
||||
|
@ -70,7 +69,7 @@ class ElasticSearch(BaseSearch):
|
|||
# Delete old index
|
||||
try:
|
||||
self.es.delete_index(self.es_index)
|
||||
except ElasticHttpNotFoundError:
|
||||
except:
|
||||
pass
|
||||
|
||||
# Settings
|
||||
|
@ -195,7 +194,7 @@ class ElasticSearch(BaseSearch):
|
|||
# Delete document
|
||||
try:
|
||||
self.es.delete(self.es_index, obj.indexed_get_content_type(), doc_id)
|
||||
except ElasticHttpNotFoundError:
|
||||
except:
|
||||
pass # Document doesn't exist, ignore this exception
|
||||
|
||||
def search(self, query_string, model, fields=None, filters={}, prefetch_related=[]):
|
||||
|
|
Ładowanie…
Reference in New Issue