elasticsearch
elasticsearch copied to clipboard
Validating mappings when simulate ingest is called
This adds functionality to the simulate ingest API (#101409). If the index exists when the ingest simulate API is called that the transformed documents would be indexed into if this were not a simulation, then it now reports any mapping validations that would occur. For example, if we have an index named test-index
with strict mappings and a single property named foo
, then:
POST _ingest/_simulate?pretty&index=test-index
{
"docs": [
{
"_source": {
"foob": "bar"
}
},
{
"_source": {
"foo": "baz"
}
}
]
}
would result in something like:
{
"docs" : [
{
"doc" : {
"_id" : "id",
"_index" : "test-index",
"_version" : -3,
"_source" : {
"foob" : "bar"
},
"executed_pipelines" : [
"test-pipeline"
],
"error" : {
"type" : "strict_dynamic_mapping_exception",
"reason" : "[1:9] mapping set to strict, dynamic introduction of [foob] within [_doc] is not allowed"
}
}
},
{
"doc" : {
"_id" : "id",
"_index" : "test-index",
"_version" : -3,
"_source" : {
"foo" : "baz"
},
"executed_pipelines" : [
"test-pipeline"
]
}
}
]
}
Hi @masseyke, I've created a changelog YAML for you.
Closed in favor of #110606