Search establishment by region id
(cherry picked from commit 7a5774a)
This commit is contained in:
parent
267544a0b1
commit
dbe39ae5cb
|
|
@ -55,6 +55,27 @@ class EstablishmentDocument(Document):
|
||||||
properties=OBJECT_FIELD_PROPERTIES),
|
properties=OBJECT_FIELD_PROPERTIES),
|
||||||
},
|
},
|
||||||
multi=True)
|
multi=True)
|
||||||
|
products = fields.ObjectField(
|
||||||
|
properties={
|
||||||
|
'wine_region': fields.ObjectField(properties={
|
||||||
|
'id': fields.IntegerField(),
|
||||||
|
'name': fields.KeywordField(),
|
||||||
|
'country': fields.ObjectField(properties={
|
||||||
|
'id': fields.IntegerField(),
|
||||||
|
'name': fields.ObjectField(attr='name_indexing',
|
||||||
|
properties=OBJECT_FIELD_PROPERTIES),
|
||||||
|
'code': fields.KeywordField(),
|
||||||
|
}),
|
||||||
|
# 'coordinates': fields.GeoPointField(),
|
||||||
|
'description': fields.ObjectField(attr='description_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||||
|
}),
|
||||||
|
'wine_sub_region': fields.ObjectField(properties={
|
||||||
|
'id': fields.IntegerField(),
|
||||||
|
'name': fields.KeywordField(),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
multi=True
|
||||||
|
)
|
||||||
schedule = fields.ListField(fields.ObjectField(
|
schedule = fields.ListField(fields.ObjectField(
|
||||||
properties={
|
properties={
|
||||||
'id': fields.IntegerField(attr='id'),
|
'id': fields.IntegerField(attr='id'),
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,20 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
|
||||||
constants.LOOKUP_QUERY_IN,
|
constants.LOOKUP_QUERY_IN,
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
'wine_region_id': {
|
||||||
|
'field': 'products.wine_region.id',
|
||||||
|
'lookups': [
|
||||||
|
constants.LOOKUP_QUERY_IN,
|
||||||
|
constants.LOOKUP_QUERY_EXCLUDE,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'wine_sub_region_id': {
|
||||||
|
'field': 'products.wine_sub_region_id',
|
||||||
|
'lookups': [
|
||||||
|
constants.LOOKUP_QUERY_IN,
|
||||||
|
constants.LOOKUP_QUERY_EXCLUDE,
|
||||||
|
],
|
||||||
|
},
|
||||||
'country_id': {
|
'country_id': {
|
||||||
'field': 'address.city.country.id'
|
'field': 'address.city.country.id'
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user