diff --git a/apps/search_indexes/documents/establishment.py b/apps/search_indexes/documents/establishment.py index 7138cabd..f5305991 100644 --- a/apps/search_indexes/documents/establishment.py +++ b/apps/search_indexes/documents/establishment.py @@ -55,6 +55,10 @@ class EstablishmentDocument(Document): ), } ) + collections = fields.ObjectField(properties={ + 'id': fields.IntegerField(attr='collection.id'), + 'collection_type': fields.IntegerField(attr='collection.collection_type'), + }) class Django: diff --git a/apps/search_indexes/serializers.py b/apps/search_indexes/serializers.py index ed8b65eb..e81535ec 100644 --- a/apps/search_indexes/serializers.py +++ b/apps/search_indexes/serializers.py @@ -60,6 +60,7 @@ class EstablishmentDocumentSerializer(DocumentSerializer): 'description_translated', 'tags', 'address', + 'collections', ) @staticmethod diff --git a/apps/search_indexes/views.py b/apps/search_indexes/views.py index 2accb3e5..52a99470 100644 --- a/apps/search_indexes/views.py +++ b/apps/search_indexes/views.py @@ -91,5 +91,8 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet): }, 'tags_category_id': { 'field': 'tags.category.id', - } + }, + 'collection_type': { + 'field': 'collections.collection_type' + }, }