Feature/cook news search

This commit is contained in:
Semyon Yekhmenin 2019-11-13 15:01:06 +00:00 committed by Олег Хаятов
parent 3641d88a05
commit 9b3d42147a
2 changed files with 9 additions and 0 deletions

View File

@ -31,6 +31,7 @@ class NewsDocument(Document):
'id': fields.IntegerField(attr='id'),
'label': fields.ObjectField(attr='label_indexing',
properties=OBJECT_FIELD_PROPERTIES),
'value': fields.KeywordField()
},
multi=True)

View File

@ -43,6 +43,14 @@ class NewsDocumentViewSet(BaseDocumentViewSet):
'field': 'tags.id',
'lookups': [
constants.LOOKUP_QUERY_IN,
constants.LOOKUP_QUERY_EXCLUDE
]
},
'tag_value': {
'field': 'tags.value',
'lookups': [
constants.LOOKUP_QUERY_IN,
constants.LOOKUP_QUERY_EXCLUDE
]
},
'slug': 'slug',