ES Establishment tags. indexing & search
This commit is contained in:
parent
2908286e6c
commit
39b2fc49b5
|
|
@ -18,8 +18,13 @@ class EstablishmentDocument(Document):
|
|||
properties=OBJECT_FIELD_PROPERTIES)
|
||||
tags = fields.ObjectField(
|
||||
properties={
|
||||
'id': fields.IntegerField(attr='id'),
|
||||
'label': fields.ObjectField(attr='label')
|
||||
'id': fields.IntegerField(attr='metadata.id'),
|
||||
'label': fields.ObjectField(attr='metadata.label_indexing',
|
||||
properties=OBJECT_FIELD_PROPERTIES),
|
||||
'category': fields.ObjectField(attr='metadata.category',
|
||||
properties={
|
||||
'id': fields.IntegerField(),
|
||||
})
|
||||
},
|
||||
multi=True)
|
||||
address = fields.ObjectField(
|
||||
|
|
@ -61,5 +66,5 @@ class EstablishmentDocument(Document):
|
|||
'price_level',
|
||||
)
|
||||
|
||||
def prepare_tags(self, instance):
|
||||
return instance.tags_indexing
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().published()
|
||||
|
|
|
|||
|
|
@ -85,5 +85,11 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
|
|||
},
|
||||
'country': {
|
||||
'field': 'address.city.country.code'
|
||||
},
|
||||
'tags_id': {
|
||||
'field': 'tags.id',
|
||||
},
|
||||
'tags_category_id': {
|
||||
'field': 'tags.category.id',
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user