Removed root content type name from document ids

This hasn't been required since we separated indices per root content
type for Elasticsearch 2 support.
pull/4502/merge
Karl Hobley 2017-12-14 15:16:31 +00:00 zatwierdzone przez Matt Westcott
rodzic 09c8843b7f
commit 0d7faef513
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -7,6 +7,9 @@ class Elasticsearch6Mapping(Elasticsearch5Mapping):
all_field_name = '_all_text'
edgengrams_field_name = '_edgengrams'
def get_document_id(self, obj):
return str(obj.pk)
def get_document_type(self):
return 'doc'

Wyświetl plik

@ -547,7 +547,7 @@ class TestElasticsearch6Mapping(TestCase):
self.assertDictEqual(mapping, expected_result)
def test_get_document_id(self):
self.assertEqual(self.es_mapping.get_document_id(self.obj), 'searchtests_book:' + str(self.obj.pk))
self.assertEqual(self.es_mapping.get_document_id(self.obj), str(self.obj.pk))
def test_get_document(self):
# Get document
@ -652,7 +652,7 @@ class TestElasticsearch6MappingInheritance(TestCase):
# This must be tests_searchtest instead of 'tests_searchtest_tests_searchtestchild'
# as it uses the contents base content type name.
# This prevents the same object being accidentally indexed twice.
self.assertEqual(self.es_mapping.get_document_id(self.obj), 'searchtests_book:' + str(self.obj.pk))
self.assertEqual(self.es_mapping.get_document_id(self.obj), str(self.obj.pk))
def test_get_document(self):
# Build document