Steps to reproduce
enabled=falsecurl -XPUT -H 'Content-Type:application/json' 'localhost:9200/twitter' -d '
{
"mappings": {
"doc": {
"properties": {
"session": {
"type": "object",
"enabled": false
}
}
}
}
}'
enabled=true and received an acknowledgmentcurl -XPOST -H 'Content-Type:application/json' 'localhost:9200/twitter/_mapping/doc' -d '
{
"properties": {
"session": {
"type": "object",
"enabled": true
}
}
}'
curl 'localhost:9200/twitter/_mapping/doc'
{"twitter":{"mappings":{"doc":{"properties":{"session":{"type":"object","enabled":false}}}}}}
I am not sure if we support updating enabled attribute but we should not acknowledge if the update does not take effect.
The code seems to assume this property is updateable too.
That said maybe this bug gives us an opportunity to reconsider this. Enabling a disabled object means that all sub fields indexed prior to the enablement of the object will be ignored, but not those indexed after the object has been enabled. This can make issues harder to track, and could create all kinds of weird situations, like indices that refuse to reindex with the same mappings, etc. I can't find the issue but I believe the same argument made us disallow updating the date format on date fields in the past.
We disallowed updating the date format in https://github.com/elastic/elasticsearch/issues/25271.
@jpountz I understand your argument, but wouldn't that same logic also apply to the "dynamic" attribute then?
Indeed. true and strict are fine, but not false.
We are discussing a related issue on #12366. We will come back to this one when we reach agreement on #12366.
Closed by #33933.
Most helpful comment
The code seems to assume this property is updateable too.
That said maybe this bug gives us an opportunity to reconsider this. Enabling a disabled object means that all sub fields indexed prior to the enablement of the object will be ignored, but not those indexed after the object has been enabled. This can make issues harder to track, and could create all kinds of weird situations, like indices that refuse to reindex with the same mappings, etc. I can't find the issue but I believe the same argument made us disallow updating the date format on
datefields in the past.