diff --git a/oscar_elasticsearch/search/mappings/products/mappings.py b/oscar_elasticsearch/search/mappings/products/mappings.py index 049fb10..37fe345 100644 --- a/oscar_elasticsearch/search/mappings/products/mappings.py +++ b/oscar_elasticsearch/search/mappings/products/mappings.py @@ -164,3 +164,8 @@ def suggest(self, *args): ) def title(self, title): return title, title, title + + @odin.assign_field + def parent_id(self): + if self.source.parent: + return self.source.parent.id