-
Notifications
You must be signed in to change notification settings - Fork 25.4k
Closed
Labels
:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>bugTeam:StorageEngine
Description
Elasticsearch Version
main
Installed Plugins
No response
Java Version
bundled
OS Version
MacOS 15.2
Problem Description
When using subobjects: false
, the usual validation when changing field types is not triggered. Elasticsearch does change the type but will fail ingesting additional documents.
Steps to Reproduce
// step 1: create index
PUT my-index
{
"mappings": {
"subobjects": false,
"properties": {
"user.id": {
"type": "long"
}
}
}
}
// step 2: add some data
POST my-index/_doc
{
"user.id": 123
}
// step 3: change mapping (succeeds by shouldn't)
PUT my-index/_mapping
{
"properties": {
"user.id": {
"type": "keyword"
}
}
}
// step 4:trying to add more data fails
POST my-index/_doc
{
"user.id": 123
}
This fails in step 4 with cannot change field "user.id" from index options=NONE to inconsistent index options=DOCS
Executing the same series of commands but omitting "subobjects": false
in step 1 fails as expected in step 3 with mapper [user.id] cannot be changed from type [long] to [keyword]
- this is what should happen with subobjects: false
as well.
Logs (if relevant)
No response
Metadata
Metadata
Assignees
Labels
:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>bugTeam:StorageEngine