Ensure index.mapping.single_type can only be set on 5.x indices#25375
Ensure index.mapping.single_type can only be set on 5.x indices#25375s1monw merged 10 commits intoelastic:masterfrom
index.mapping.single_type can only be set on 5.x indices#25375Conversation
In 6.x we prevent multiple types and default to `index.mapping.single_type: false` This change removes the registered setting and ensures that it's preserved for 5.x indices. Relates to elastic#24961
nik9000
left a comment
There was a problem hiding this comment.
LGTM anytime the tests are ready for it.
| case IndexSettings.INDEX_MAPPING_SINGLE_TYPE_SETTING_KEY: | ||
| // this was settable in 5.x but not anymore in 6.x so we have to preserve the value ie. make it read-only | ||
| // this can be removed in later versions | ||
| return true; |
| private static MappedFieldType defaultFieldType(IndexSettings indexSettings) { | ||
| MappedFieldType defaultFieldType = Defaults.FIELD_TYPE.clone(); | ||
| if (MapperService.INDEX_MAPPING_SINGLE_TYPE_SETTING.get(indexSettings)) { | ||
| if (indexSettings.isSingleType()) { |
|
|
||
| @Before | ||
| public void setup() throws Exception { | ||
| indexService = createIndex("test", Settings.builder().put("mapping.single_type", false).build()); |
| - match: { hits.total: 5 } # just check we recovered fine | ||
|
|
||
|
|
||
| - do: |
This change removes the remaining explicitly specified `index.mapper.single_type` settings from tests in order to allow the removal of the setting. This is the already approved part of elastic#25375 broken out to simplfiy reviews on
|
Sorry I know this is closed but in case someone else ends up here from a web search... Seems https://www.elastic.co/guide/en/elasticsearch/reference/6.7/removal-of-types.html falsely claims that
This fails against ES 6.8.3 with a 400 error: I tried adding PS: having to add a parameter for a release, then remove it for the next release, makes it hard for an app to support multiple ES versions. |
In 6.x we prevent multiple types and default to
index.mapping.single_type: falseThis change removes the registered setting and ensures that it's preserved for
5.x indices.
Relates to #24961
Note this might still fail since not all places are cut over