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