Indexing products is ready
This commit is contained in:
parent
692f4ba3ab
commit
a91ba7e6f3
|
|
@ -160,7 +160,7 @@ class WineRegionQuerySet(models.QuerySet):
|
|||
"""Wine region queryset."""
|
||||
|
||||
|
||||
class WineRegion(models.Model):
|
||||
class WineRegion(models.Model, TranslatedFieldsMixin):
|
||||
"""Wine region model."""
|
||||
name = models.CharField(_('name'), max_length=255)
|
||||
country = models.ForeignKey(Country, on_delete=models.PROTECT,
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ class ProductDocument(Document):
|
|||
properties=OBJECT_FIELD_PROPERTIES)
|
||||
product_type = fields.ObjectField(properties={
|
||||
'id': fields.IntegerField(),
|
||||
'name': fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES),
|
||||
'name': fields.ObjectField(attr='name_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||
'index_name': fields.KeywordField(),
|
||||
'use_subtypes': fields.BooleanField(),
|
||||
})
|
||||
subtypes = fields.ObjectField(
|
||||
properties={
|
||||
'name': fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES),
|
||||
'name': fields.ObjectField(attr='name_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||
'index_name': fields.KeywordField(),
|
||||
},
|
||||
multi=True
|
||||
|
|
@ -35,8 +35,8 @@ class ProductDocument(Document):
|
|||
properties=OBJECT_FIELD_PROPERTIES),
|
||||
'code': fields.KeywordField(),
|
||||
}),
|
||||
'coordinates': fields.GeoPointField(),
|
||||
'description': fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES),
|
||||
# 'coordinates': fields.GeoPointField(),
|
||||
'description': fields.ObjectField(attr='description_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||
})
|
||||
wine_sub_region = fields.ObjectField(properties={'name': fields.KeywordField()})
|
||||
classifications = fields.ObjectField( # TODO
|
||||
|
|
@ -45,14 +45,14 @@ class ProductDocument(Document):
|
|||
'standard': fields.ObjectField(properties={
|
||||
'name': fields.KeywordField(),
|
||||
'standard_type': fields.IntegerField(),
|
||||
'coordinates': fields.GeoPointField(),
|
||||
# 'coordinates': fields.GeoPointField(),
|
||||
}),
|
||||
'tags': fields.ObjectField(
|
||||
properties={
|
||||
'label': fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES),
|
||||
'label': fields.ObjectField(attr='label_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||
'value': fields.KeywordField(),
|
||||
'category': fields.ObjectField(properties={
|
||||
'label': fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES),
|
||||
'label': fields.ObjectField(attr='label_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||
'public': fields.BooleanField(),
|
||||
'index_name': fields.KeywordField(),
|
||||
'value_type': fields.KeywordField(),
|
||||
|
|
@ -72,9 +72,9 @@ class ProductDocument(Document):
|
|||
standards = fields.ObjectField(
|
||||
properties={
|
||||
'id': fields.IntegerField(),
|
||||
'name': fields.ObjectField(attr='name_indexing',
|
||||
properties=OBJECT_FIELD_PROPERTIES),
|
||||
'code': fields.KeywordField(),
|
||||
'name': fields.KeywordField(),
|
||||
'standard_type': fields.IntegerField(),
|
||||
# 'coordinates': fields.GeoPointField(),
|
||||
},
|
||||
multi=True
|
||||
)
|
||||
|
|
@ -83,10 +83,10 @@ class ProductDocument(Document):
|
|||
})
|
||||
tags = fields.ObjectField(
|
||||
properties={
|
||||
'label': fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES),
|
||||
'label': fields.ObjectField(attr='label_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||
'value': fields.KeywordField(),
|
||||
'category': fields.ObjectField(properties={
|
||||
'label': fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES),
|
||||
'label': fields.ObjectField(attr='label_indexing', properties=OBJECT_FIELD_PROPERTIES),
|
||||
'public': fields.BooleanField(),
|
||||
'index_name': fields.KeywordField(),
|
||||
'value_type': fields.KeywordField(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user