Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,17 @@ public void testShrinkAfterUpgrade() throws IOException {
if (runningAgainstOldCluster) {
XContentBuilder mappingsAndSettings = jsonBuilder();
mappingsAndSettings.startObject();
if (oldClusterVersion.major == 5 && randomBoolean()) {
{
// test that mapping.single_type is correctly propagated on the shrinked index,
// if not, search will fail.
mappingsAndSettings.startObject("settings");
mappingsAndSettings.startObject("mapping");
mappingsAndSettings.field("single_type", true);
mappingsAndSettings.endObject();
mappingsAndSettings.endObject();
}
}
{
mappingsAndSettings.startObject("mappings");
mappingsAndSettings.startObject("doc");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -695,9 +695,9 @@ static void prepareResizeIndexSettings(ClusterState currentState, Set<String> ma
}

final Predicate<String> sourceSettingsPredicate = (s) -> s.startsWith("index.similarity.")
|| s.startsWith("index.analysis.") || s.startsWith("index.sort.");
|| s.startsWith("index.analysis.") || s.startsWith("index.sort.") || s.equals("index.mapping.single_type");
indexSettingsBuilder
// now copy all similarity / analysis / sort settings - this overrides all settings from the user unless they
// now copy all similarity / analysis / sort / single_type settings - this overrides all settings from the user unless they
// wanna add extra settings
.put(IndexMetaData.SETTING_VERSION_CREATED, sourceMetaData.getCreationVersion())
.put(IndexMetaData.SETTING_VERSION_UPGRADED, sourceMetaData.getUpgradedVersion())
Expand Down