diff --git a/apps/establishment/models.py b/apps/establishment/models.py index 4b4cbbea..fe81d9ef 100644 --- a/apps/establishment/models.py +++ b/apps/establishment/models.py @@ -11,7 +11,6 @@ from django.db import models from django.db.models import When, Case, F, ExpressionWrapper, Subquery, Q from django.utils import timezone from django.utils.translation import gettext_lazy as _ -from elasticsearch_dsl import Q as Elastic_Q from phonenumber_field.modelfields import PhoneNumberField from collection.models import Collection @@ -99,15 +98,15 @@ class EstablishmentQuerySet(models.QuerySet): else: return self.none() - def es_search(self, value, locale=None): - """Search text via ElasticSearch.""" - from search_indexes.documents import EstablishmentDocument - search = EstablishmentDocument.search().filter( - Elastic_Q('match', name=value) | - Elastic_Q('match', **{f'description.{locale}': value}) - ).execute() - ids = [result.meta.id for result in search] - return self.filter(id__in=ids) + # def es_search(self, value, locale=None): + # """Search text via ElasticSearch.""" + # from search_indexes.documents import EstablishmentDocument + # search = EstablishmentDocument.search().filter( + # Elastic_Q('match', name=value) | + # Elastic_Q('match', **{f'description.{locale}': value}) + # ).execute() + # ids = [result.meta.id for result in search] + # return self.filter(id__in=ids) def by_country_code(self, code): """Return establishments by country code"""