Try to fix indexing

This commit is contained in:
Kuroshini 2019-10-16 14:11:07 +03:00
parent 141bddc0db
commit 3bf029616f
2 changed files with 3 additions and 3 deletions

View File

@ -79,8 +79,8 @@ class ProductQuerySet(models.QuerySet):
return self.select_related('product_type', 'establishment') \
.prefetch_related('product_type__subtypes')
def with_es_related(self):
"""Returns qs with related for ES indexing."""
def with_extended_related(self):
"""Returns qs with almost all related objects."""
return self.with_base_related() \
.prefetch_related('tags', 'standards', 'classifications', 'classifications__standard',
'classifications__classification_type', 'classifications__tags') \

View File

@ -113,4 +113,4 @@ class ProductDocument(Document):
related_models = [models.ProductType]
def get_queryset(self):
return super().get_queryset().published().with_es_related()
return super().get_queryset().published().with_base_related()