ES. Establishment type & subtypes
This commit is contained in:
parent
4005fad64a
commit
8e0b19b8b0
|
|
@ -16,6 +16,19 @@ class EstablishmentDocument(Document):
|
|||
|
||||
description = fields.ObjectField(attr='description_indexing',
|
||||
properties=OBJECT_FIELD_PROPERTIES)
|
||||
establishment_type = fields.ObjectField(
|
||||
properties={
|
||||
'id': fields.IntegerField(),
|
||||
'name': fields.ObjectField(attr='name_indexing',
|
||||
properties=OBJECT_FIELD_PROPERTIES)
|
||||
})
|
||||
establishment_subtypes = fields.ObjectField(
|
||||
properties={
|
||||
'id': fields.IntegerField(),
|
||||
'name': fields.ObjectField(attr='name_indexing',
|
||||
properties=OBJECT_FIELD_PROPERTIES)
|
||||
},
|
||||
multi=True)
|
||||
tags = fields.ObjectField(
|
||||
properties={
|
||||
'id': fields.IntegerField(attr='metadata.id'),
|
||||
|
|
@ -55,10 +68,12 @@ class EstablishmentDocument(Document):
|
|||
),
|
||||
}
|
||||
)
|
||||
collections = fields.ObjectField(properties={
|
||||
collections = fields.ObjectField(
|
||||
properties={
|
||||
'id': fields.IntegerField(attr='collection.id'),
|
||||
'collection_type': fields.IntegerField(attr='collection.collection_type'),
|
||||
})
|
||||
},
|
||||
multi=True)
|
||||
|
||||
class Django:
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ class EstablishmentDocumentSerializer(DocumentSerializer):
|
|||
'tags',
|
||||
'address',
|
||||
'collections',
|
||||
'establishment_type',
|
||||
'establishment_subtypes',
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
|
|
|||
|
|
@ -97,6 +97,12 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
|
|||
'collection_type': {
|
||||
'field': 'collections.collection_type'
|
||||
},
|
||||
'establishment_type': {
|
||||
'field': 'establishment_type.id'
|
||||
},
|
||||
'establishment_subtypes': {
|
||||
'field': 'establishment_subtypes.id'
|
||||
},
|
||||
}
|
||||
|
||||
geo_spatial_filter_fields = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user