-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Index creation requests can accept malformed mappings. #38266
Copy link
Copy link
Closed
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Description
CreateIndexRequest#source(Map<String, Object>, ... ), which is used when deserializing index creation requests, is too lenient and accidentally accepts mappings that are nested twice under the type key:
{
"mappings": {
"my_type": {
"my_type": {
"properties": { ... }
}
}
}
We will soon be trying to remove types completely from the server code, so it is likely not high-priority to fix. But it seemed worth filing an issue as the behavior is quite confusing and has lead to some surprising bugs when trying to introduce typeless create index requests.
The method PutIndexTemplateRequest#source has the same issue as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
:Search Foundations/MappingIndex mappings, including merging and defining field typesIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in ElasticsearchMeta label for the Search Foundations team in Elasticsearch
Type
Fields
Give feedbackNo fields configured for issues without a type.