Skip to content

Commit d0e7151

Browse files
authored
Enforce at most one type. (#24428)
This is a follow-up to #24317, which did the hard work but was merged in such a way that it exposes the setting while still allowing indices to have multiple types by default in order to give time to people who test against master to add this setting to their index settings.
1 parent 48031a2 commit d0e7151

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

core/src/main/java/org/elasticsearch/index/mapper/MapperService.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,10 @@ public enum MergeReason {
9999
public static final Setting<Boolean> INDEX_MAPPING_SINGLE_TYPE_SETTING;
100100
static {
101101
Function<Settings, String> defValue = settings -> {
102-
// TODO: uncomment this
103-
/*boolean singleType = true;
102+
boolean singleType = true;
104103
if (settings.getAsVersion(IndexMetaData.SETTING_VERSION_CREATED, null) != null) {
105104
singleType = Version.indexCreated(settings).onOrAfter(Version.V_6_0_0_alpha1_UNRELEASED);
106-
}*/
107-
boolean singleType = false;
105+
}
108106
return Boolean.valueOf(singleType).toString();
109107
};
110108
INDEX_MAPPING_SINGLE_TYPE_SETTING = Setting.boolSetting("index.mapping.single_type", defValue, Property.IndexScope, Property.Final);

core/src/test/java/org/elasticsearch/index/mapper/MapperServiceTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ public void testIndexSortWithNestedFields() throws IOException {
310310
containsString("cannot have nested fields when index sort is activated"));
311311
}
312312

313-
@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/pull/24317#issuecomment-297624290")
314313
public void testForbidMultipleTypes() throws IOException {
315314
String mapping = XContentFactory.jsonBuilder().startObject().startObject("type").endObject().endObject().string();
316315
MapperService mapperService = createIndex("test").mapperService();

0 commit comments

Comments
 (0)