update settings, update establishment document
This commit is contained in:
parent
8e864d32b9
commit
db5ff7afcd
|
|
@ -14,7 +14,6 @@ EstablishmentIndex.settings(number_of_shards=1, number_of_replicas=1)
|
||||||
class EstablishmentDocument(Document):
|
class EstablishmentDocument(Document):
|
||||||
"""Establishment document."""
|
"""Establishment document."""
|
||||||
|
|
||||||
name = fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES)
|
|
||||||
description = fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES)
|
description = fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES)
|
||||||
tags = fields.ObjectField(
|
tags = fields.ObjectField(
|
||||||
properties={
|
properties={
|
||||||
|
|
@ -28,14 +27,12 @@ class EstablishmentDocument(Document):
|
||||||
model = models.Establishment
|
model = models.Establishment
|
||||||
fields = (
|
fields = (
|
||||||
'id',
|
'id',
|
||||||
|
'name',
|
||||||
'public_mark',
|
'public_mark',
|
||||||
'toque_number',
|
'toque_number',
|
||||||
'price_level',
|
'price_level',
|
||||||
)
|
)
|
||||||
|
|
||||||
def prepare_name(self, instance):
|
|
||||||
return instance.name
|
|
||||||
|
|
||||||
def prepare_description(self, instance):
|
def prepare_description(self, instance):
|
||||||
return instance.description
|
return instance.description
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ class NewsDocumentSerializer(DocumentSerializer):
|
||||||
class EstablishmentDocumentSerializer(DocumentSerializer):
|
class EstablishmentDocumentSerializer(DocumentSerializer):
|
||||||
"""Establishment document serializer."""
|
"""Establishment document serializer."""
|
||||||
|
|
||||||
name_translated = serializers.SerializerMethodField(allow_null=True)
|
|
||||||
description_translated = serializers.SerializerMethodField(allow_null=True)
|
description_translated = serializers.SerializerMethodField(allow_null=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
@ -57,15 +56,10 @@ class EstablishmentDocumentSerializer(DocumentSerializer):
|
||||||
'public_mark',
|
'public_mark',
|
||||||
'toque_number',
|
'toque_number',
|
||||||
'price_level',
|
'price_level',
|
||||||
'name_translated',
|
|
||||||
'description_translated',
|
'description_translated',
|
||||||
'tags',
|
'tags',
|
||||||
)
|
)
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def get_name_translated(obj):
|
|
||||||
return get_translated_value(obj.name)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_description_translated(obj):
|
def get_description_translated(obj):
|
||||||
return get_translated_value(obj.description)
|
return get_translated_value(obj.description)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,6 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
|
||||||
'price_level',
|
'price_level',
|
||||||
)
|
)
|
||||||
translated_search_fields = (
|
translated_search_fields = (
|
||||||
'name',
|
|
||||||
'description',
|
'description',
|
||||||
)
|
)
|
||||||
filter_fields = {
|
filter_fields = {
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,17 @@ SCHEMA_URI = 'http'
|
||||||
DEFAULT_SUBDOMAIN = 'www'
|
DEFAULT_SUBDOMAIN = 'www'
|
||||||
SITE_DOMAIN_URI = 'id-east.ru'
|
SITE_DOMAIN_URI = 'id-east.ru'
|
||||||
DOMAIN_URI = 'gm.id-east.ru'
|
DOMAIN_URI = 'gm.id-east.ru'
|
||||||
|
|
||||||
|
|
||||||
|
# ELASTICSEARCH SETTINGS
|
||||||
|
ELASTICSEARCH_DSL = {
|
||||||
|
'default': {
|
||||||
|
'hosts': 'localhost:9200'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ELASTICSEARCH_INDEX_NAMES = {
|
||||||
|
'search_indexes.documents.news': 'development_news',
|
||||||
|
'search_indexes.documents.establishment': 'development_establishment',
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,17 @@ SCHEMA_URI = 'https'
|
||||||
DEFAULT_SUBDOMAIN = 'www'
|
DEFAULT_SUBDOMAIN = 'www'
|
||||||
SITE_DOMAIN_URI = 'id-east.ru'
|
SITE_DOMAIN_URI = 'id-east.ru'
|
||||||
DOMAIN_URI = 'gm-stage.id-east.ru'
|
DOMAIN_URI = 'gm-stage.id-east.ru'
|
||||||
|
|
||||||
|
|
||||||
|
# ELASTICSEARCH SETTINGS
|
||||||
|
ELASTICSEARCH_DSL = {
|
||||||
|
'default': {
|
||||||
|
'hosts': 'localhost:9200'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ELASTICSEARCH_INDEX_NAMES = {
|
||||||
|
'search_indexes.documents.news': 'stage_news',
|
||||||
|
'search_indexes.documents.establishment': 'stage_establishment',
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user