From 3bf029616f1bdb37086c1fb3e7010d76baaf63fd Mon Sep 17 00:00:00 2001 From: Kuroshini Date: Wed, 16 Oct 2019 14:11:07 +0300 Subject: [PATCH] Try to fix indexing --- apps/product/models.py | 4 ++-- apps/search_indexes/documents/product.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/product/models.py b/apps/product/models.py index 0c19b01e..ba9ccd38 100644 --- a/apps/product/models.py +++ b/apps/product/models.py @@ -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') \ diff --git a/apps/search_indexes/documents/product.py b/apps/search_indexes/documents/product.py index 4852e0e6..b00f3f50 100644 --- a/apps/search_indexes/documents/product.py +++ b/apps/search_indexes/documents/product.py @@ -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()