kopia lustrzana https://github.com/wagtail/wagtail
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
rodzic
09c8843b7f
commit
0d7faef513
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue