Change value of "store" property to a boolean

This affects all search backends as it always should've been a boolean.
Older versions of Elasticsearch coerced it to a boolean but ES5 doesn't
appear to do this anymore.
pull/3173/merge
Karl Hobley 2016-11-08 09:58:28 +00:00 zatwierdzone przez Matt Westcott
rodzic a5e7fbbb0f
commit abb993f901
4 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -112,7 +112,7 @@ class ElasticsearchMapping(object):
def get_mapping(self):
# Make field list
fields = {
'pk': dict(type=self.keyword_type, index='not_analyzed', store='yes', include_in_all=False),
'pk': dict(type=self.keyword_type, index='not_analyzed', store=True, include_in_all=False),
'content_type': dict(type=self.keyword_type, index='not_analyzed', include_in_all=False),
'_partials': dict(type=self.text_type, include_in_all=False),
}

Wyświetl plik

@ -754,7 +754,7 @@ class TestElasticsearch2Mapping(TestCase):
expected_result = {
'searchtests_searchtest': {
'properties': {
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': 'yes', 'include_in_all': False},
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': True, 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'_partials': {'analyzer': 'edgengram_analyzer', 'search_analyzer': 'standard', 'include_in_all': False, 'type': 'string'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},
@ -849,7 +849,7 @@ class TestElasticsearch2MappingInheritance(TestCase):
},
# Inherited
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': 'yes', 'include_in_all': False},
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': True, 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'_partials': {'analyzer': 'edgengram_analyzer', 'search_analyzer': 'standard', 'include_in_all': False, 'type': 'string'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},

Wyświetl plik

@ -753,7 +753,7 @@ class TestElasticsearch5Mapping(TestCase):
expected_result = {
'searchtests_searchtest': {
'properties': {
'pk': {'index': 'not_analyzed', 'type': 'keyword', 'store': 'yes', 'include_in_all': False},
'pk': {'index': 'not_analyzed', 'type': 'keyword', 'store': True, 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'keyword', 'include_in_all': False},
'_partials': {'analyzer': 'edgengram_analyzer', 'search_analyzer': 'standard', 'include_in_all': False, 'type': 'text'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},
@ -848,7 +848,7 @@ class TestElasticsearch5MappingInheritance(TestCase):
},
# Inherited
'pk': {'index': 'not_analyzed', 'type': 'keyword', 'store': 'yes', 'include_in_all': False},
'pk': {'index': 'not_analyzed', 'type': 'keyword', 'store': True, 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'keyword', 'include_in_all': False},
'_partials': {'analyzer': 'edgengram_analyzer', 'search_analyzer': 'standard', 'include_in_all': False, 'type': 'text'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},

Wyświetl plik

@ -759,7 +759,7 @@ class TestElasticsearchMapping(TestCase):
expected_result = {
'searchtests_searchtest': {
'properties': {
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': 'yes', 'include_in_all': False},
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': True, 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'_partials': {'index_analyzer': 'edgengram_analyzer', 'include_in_all': False, 'type': 'string'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},
@ -854,7 +854,7 @@ class TestElasticsearchMappingInheritance(TestCase):
},
# Inherited
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': 'yes', 'include_in_all': False},
'pk': {'index': 'not_analyzed', 'type': 'string', 'store': True, 'include_in_all': False},
'content_type': {'index': 'not_analyzed', 'type': 'string', 'include_in_all': False},
'_partials': {'index_analyzer': 'edgengram_analyzer', 'include_in_all': False, 'type': 'string'},
'live_filter': {'index': 'not_analyzed', 'type': 'boolean', 'include_in_all': False},