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)
|
properties=OBJECT_FIELD_PROPERTIES)
|
||||||
tags = fields.ObjectField(
|
tags = fields.ObjectField(
|
||||||
properties={
|
properties={
|
||||||
'id': fields.IntegerField(attr='id'),
|
'id': fields.IntegerField(attr='metadata.id'),
|
||||||
'label': fields.ObjectField(attr='label')
|
'label': fields.ObjectField(attr='metadata.label_indexing',
|
||||||
|
properties=OBJECT_FIELD_PROPERTIES),
|
||||||
|
'category': fields.ObjectField(attr='metadata.category',
|
||||||
|
properties={
|
||||||
|
'id': fields.IntegerField(),
|
||||||
|
})
|
||||||
},
|
},
|
||||||
multi=True)
|
multi=True)
|
||||||
address = fields.ObjectField(
|
address = fields.ObjectField(
|
||||||
|
|
@ -61,5 +66,5 @@ class EstablishmentDocument(Document):
|
||||||
'price_level',
|
'price_level',
|
||||||
)
|
)
|
||||||
|
|
||||||
def prepare_tags(self, instance):
|
def get_queryset(self):
|
||||||
return instance.tags_indexing
|
return super().get_queryset().published()
|
||||||
|
|
|
||||||
|
|
@ -85,5 +85,11 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
|
||||||
},
|
},
|
||||||
'country': {
|
'country': {
|
||||||
'field': 'address.city.country.code'
|
'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