diff options
author | Simon Willnauer <simonw@apache.org> | 2017-06-23 10:26:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-23 10:26:06 +0200 |
commit | 4ae426a5520a0d2828fb1955deb46350844cf2f1 (patch) | |
tree | 6ee717d1807730ff744e4113e411bd1611c06752 /core/src/test/java | |
parent | 9c511bc44773e318a46aadf09f390121d5e9220a (diff) |
Remove remaining `index.mapping.single_type=false` (#25369)
This change cleans up remaining tests to not use index.mapping.single_type=false
but instead where applicable use a single type or markt the index as created
with a pre 6.x version.
Yet, there is still on leftover in the client tests that needs special attention.
See `org.elasticsearch.client.SearchIT`
Relates to #24961
Diffstat (limited to 'core/src/test/java')
-rw-r--r-- | core/src/test/java/org/elasticsearch/get/GetActionIT.java | 20 | ||||
-rw-r--r-- | core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java | 4 |
2 files changed, 7 insertions, 17 deletions
diff --git a/core/src/test/java/org/elasticsearch/get/GetActionIT.java b/core/src/test/java/org/elasticsearch/get/GetActionIT.java index 86536b00e6..f9c4b0d960 100644 --- a/core/src/test/java/org/elasticsearch/get/GetActionIT.java +++ b/core/src/test/java/org/elasticsearch/get/GetActionIT.java @@ -809,34 +809,24 @@ public class GetActionIT extends ESIntegTestCase { String createIndexSource = "{\n" + " \"settings\": {\n" + " \"index.translog.flush_threshold_size\": \"1pb\",\n" + - " \"index.mapping.single_type\": false," + " \"refresh_interval\": \"-1\"\n" + - " },\n" + - " \"mappings\": {\n" + - " \"parentdoc\": {\n" + - " },\n" + - " \"doc\": {\n" + - " \"_parent\": {\n" + - " \"type\": \"parentdoc\"\n" + - " }\n" + - " }\n" + " }\n" + "}"; assertAcked(prepareCreate("test") .addAlias(new Alias("alias")).setSource(createIndexSource, XContentType.JSON)); ensureGreen(); - client().prepareIndex("test", "doc").setId("1").setSource("{}", XContentType.JSON).setParent("1").get(); + client().prepareIndex("test", "doc", "1").setRouting("routingValue").setId("1").setSource("{}", XContentType.JSON).get(); - String[] fieldsList = {"_parent"}; + String[] fieldsList = {"_routing"}; // before refresh - document is only in translog - assertGetFieldsAlwaysWorks(indexOrAlias(), "doc", "1", fieldsList, "1"); + assertGetFieldsAlwaysWorks(indexOrAlias(), "doc", "1", fieldsList, "routingValue"); refresh(); //after refresh - document is in translog and also indexed - assertGetFieldsAlwaysWorks(indexOrAlias(), "doc", "1", fieldsList, "1"); + assertGetFieldsAlwaysWorks(indexOrAlias(), "doc", "1", fieldsList, "routingValue"); flush(); //after flush - document is in not anymore translog - only indexed - assertGetFieldsAlwaysWorks(indexOrAlias(), "doc", "1", fieldsList, "1"); + assertGetFieldsAlwaysWorks(indexOrAlias(), "doc", "1", fieldsList, "routingValue"); } public void testUngeneratedFieldsNotPartOfSourceStored() throws IOException { diff --git a/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java index 3bbd4e8146..cf7b4a233a 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/TypeFieldMapperTests.java @@ -62,8 +62,8 @@ public class TypeFieldMapperTests extends ESSingleNodeTestCase { } public void testDocValues(boolean singleType) throws IOException { - Settings indexSettings = Settings.builder() - .put("index.mapping.single_type", singleType) + Settings indexSettings = singleType ? Settings.EMPTY : Settings.builder() + .put("index.version.created", Version.V_5_6_0) .build(); MapperService mapperService = createIndex("test", indexSettings).mapperService(); DocumentMapper mapper = mapperService.merge("type", new CompressedXContent("{\"type\":{}}"), MergeReason.MAPPING_UPDATE, false); |