update ES documents

This commit is contained in:
evgeniy-st 2019-10-15 18:32:16 +03:00
parent 9d4c483f51
commit bde81b3700
2 changed files with 18 additions and 16 deletions

View File

@ -39,13 +39,15 @@ class EstablishmentDocument(Document):
}),
},
multi=True)
# tags = fields.ObjectField(
# properties={
# 'tag': fields.ObjectField(properties={
# 'id': fields.IntegerField(),
# }),
# },
# multi=True)
tags = fields.ObjectField(
properties={
'id': fields.IntegerField(attr='id'),
'label': fields.ObjectField(attr='label_indexing',
properties=OBJECT_FIELD_PROPERTIES),
'category': fields.ObjectField(attr='category',
properties={'id': fields.IntegerField()})
},
multi=True)
address = fields.ObjectField(
properties={
'id': fields.IntegerField(),

View File

@ -24,15 +24,15 @@ class NewsDocument(Document):
country = fields.ObjectField(properties={'id': fields.IntegerField(),
'code': fields.KeywordField()})
web_url = fields.KeywordField(attr='web_url')
# tags = fields.ObjectField(
# properties={
# '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)
tags = fields.ObjectField(
properties={
'id': fields.IntegerField(attr='id'),
'label': fields.ObjectField(attr='label_indexing',
properties=OBJECT_FIELD_PROPERTIES),
'category': fields.ObjectField(attr='category',
properties={'id': fields.IntegerField()})
},
multi=True)
class Django: