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):
|
||||
"""Establishment document."""
|
||||
|
||||
name = fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES)
|
||||
description = fields.ObjectField(properties=OBJECT_FIELD_PROPERTIES)
|
||||
tags = fields.ObjectField(
|
||||
properties={
|
||||
|
|
@ -28,14 +27,12 @@ class EstablishmentDocument(Document):
|
|||
model = models.Establishment
|
||||
fields = (
|
||||
'id',
|
||||
'name',
|
||||
'public_mark',
|
||||
'toque_number',
|
||||
'price_level',
|
||||
)
|
||||
|
||||
def prepare_name(self, instance):
|
||||
return instance.name
|
||||
|
||||
def prepare_description(self, instance):
|
||||
return instance.description
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ class NewsDocumentSerializer(DocumentSerializer):
|
|||
class EstablishmentDocumentSerializer(DocumentSerializer):
|
||||
"""Establishment document serializer."""
|
||||
|
||||
name_translated = serializers.SerializerMethodField(allow_null=True)
|
||||
description_translated = serializers.SerializerMethodField(allow_null=True)
|
||||
|
||||
class Meta:
|
||||
|
|
@ -57,15 +56,10 @@ class EstablishmentDocumentSerializer(DocumentSerializer):
|
|||
'public_mark',
|
||||
'toque_number',
|
||||
'price_level',
|
||||
'name_translated',
|
||||
'description_translated',
|
||||
'tags',
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def get_name_translated(obj):
|
||||
return get_translated_value(obj.name)
|
||||
|
||||
@staticmethod
|
||||
def get_description_translated(obj):
|
||||
return get_translated_value(obj.description)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ class EstablishmentDocumentViewSet(BaseDocumentViewSet):
|
|||
'price_level',
|
||||
)
|
||||
translated_search_fields = (
|
||||
'name',
|
||||
'description',
|
||||
)
|
||||
filter_fields = {
|
||||
|
|
|
|||
|
|
@ -11,3 +11,17 @@ SCHEMA_URI = 'http'
|
|||
DEFAULT_SUBDOMAIN = 'www'
|
||||
SITE_DOMAIN_URI = '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'
|
||||
SITE_DOMAIN_URI = '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