Fix imports issue
This commit is contained in:
parent
365f39ce65
commit
bd7ba611fc
|
|
@ -11,7 +11,7 @@ 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
|
||||
from elasticsearch_dsl import Q as Elastic_Q
|
||||
from phonenumber_field.modelfields import PhoneNumberField
|
||||
|
||||
from collection.models import Collection
|
||||
|
|
@ -103,8 +103,8 @@ class EstablishmentQuerySet(models.QuerySet):
|
|||
"""Search text via ElasticSearch."""
|
||||
from search_indexes.documents import EstablishmentDocument
|
||||
search = EstablishmentDocument.search().filter(
|
||||
Q('match', name=value) |
|
||||
Q('match', **{f'description.{locale}': value})
|
||||
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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user