It seems that if you disable the _source when first creating the index, and subsequent updates to the mapping will fail with Merge failed with failures {[Cannot update enabled setting for [_source]]}, even if the update doesn't change _source at all.
Tested on ES 2.1
{
"name": "Domo",
"cluster_name": "elasticsearch",
"version": {
"number": "2.1.0",
"build_hash": "72cd1f1a3eee09505e036106146dc1949dc5dc87",
"build_timestamp": "2015-11-18T22:40:03Z",
"build_snapshot": false,
"lucene_version": "5.3.1"
},
"tagline": "You Know, for Search"
}
Example
DELETE /data
PUT /data
{
"mappings": {
"data": {
"_source": {
"enabled": false
},
"properties": {
"float": {
"type": "float"
},
"double": {
"type": "double"
}
}
}
}
}
GET /data/_mapping
{
"data": {
"mappings": {
"data": {
"_source": {
"enabled": false
},
"properties": {
"double": {
"type": "double"
},
"float": {
"type": "float"
}
}
}
}
}
}
All good, but if we try to update the mapping:
PUT /data/_mapping/data
{
"properties": {
"long": {
"type": "long"
}
}
}
{
"error": {
"root_cause": [
{
"type": "merge_mapping_exception",
"reason": "Merge failed with failures {[Cannot update enabled setting for [_source]]}"
}
],
"type": "merge_mapping_exception",
"reason": "Merge failed with failures {[Cannot update enabled setting for [_source]]}"
},
"status": 400
}
If you repeat the process without touching _source, everything works as expected:
DELETE /data
PUT /data
{
"mappings": {
"data": {
"properties": {
"float": {
"type": "float"
},
"double": {
"type": "double"
}
}
}
}
}
GET /data/_mapping
PUT /data/_mapping/data
{
"properties": {
"long": {
"type": "long"
}
}
}
GET /data/_mapping
{
"data": {
"mappings": {
"data": {
"properties": {
"double": {
"type": "double"
},
"float": {
"type": "float"
},
"long": {
"type": "long"
}
}
}
}
}
}
And it doesn't seem to matter if you enable or disable _source, both cases will cause the error. It seems to be the presence of specifying _source that breaks future updates.
It seems that if you disable the
_sourcewhen first creating the index, and subsequent updates to the mapping will fail withMerge failed with failures {[Cannot update enabled setting for [_source]]}, even if the update doesn't change_sourceat all.Tested on ES 2.1
{ "name": "Domo", "cluster_name": "elasticsearch", "version": { "number": "2.1.0", "build_hash": "72cd1f1a3eee09505e036106146dc1949dc5dc87", "build_timestamp": "2015-11-18T22:40:03Z", "build_snapshot": false, "lucene_version": "5.3.1" }, "tagline": "You Know, for Search" }Example
{ "data": { "mappings": { "data": { "_source": { "enabled": false }, "properties": { "double": { "type": "double" }, "float": { "type": "float" } } } } } }All good, but if we try to update the mapping:
{ "error": { "root_cause": [ { "type": "merge_mapping_exception", "reason": "Merge failed with failures {[Cannot update enabled setting for [_source]]}" } ], "type": "merge_mapping_exception", "reason": "Merge failed with failures {[Cannot update enabled setting for [_source]]}" }, "status": 400 }If you repeat the process without touching
_source, everything works as expected:{ "data": { "mappings": { "data": { "properties": { "double": { "type": "double" }, "float": { "type": "float" }, "long": { "type": "long" } } } } } }And it doesn't seem to matter if you enable or disable _source, both cases will cause the error. It seems to be the presence of specifying _source that breaks future updates.