diff --git a/core/elasticsearch/documents.py b/core/elasticsearch/documents.py index 26868870..75df0ed2 100644 --- a/core/elasticsearch/documents.py +++ b/core/elasticsearch/documents.py @@ -63,7 +63,7 @@ class ProductDocument(_BaseDoc): return float(obj.price) if obj.price else 0.0 def prepare_top_level(self, obj): - root = obj.category.get_family().first() if obj.category else None + root = obj.category.get_root() if obj.category else None return root.slug if root else "other" def prepare_product_type(self, obj):