-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
This was previously reported by @brwe on #5972 but closed in favour of this comment #6736 (comment) on #6736. That issue is now closed however so opening this again as a separate ticket so it won't be buried in the field name/path resolution refactor.
Consider the following mapping:
DELETE index123
PUT index123
{
"mappings": {
"people": {
"properties": {
"o.x.y": {
"type": "string",
"analyzer": "standard"
},
"o.x.z": {
"type": "string",
"boost": 2
}
}
}
}
}
POST index123/people
{
"o" : {
"x" : {
"y" : "this is analyzed",
"z" : "2015-05-25T22:13:04+02:00"
}
}
}
When we do a GET index123/_mapping
we get the following mapping for people:
{
"people": {
"properties": {
"o": {
"properties": {
"x": {
"properties": {
"y": {
"type": "string"
},
"z": {
"type": "date",
"format": "dateOptionalTime"
}
}
}
}
},
"o.x.y": {
"type": "string",
"analyzer": "standard"
},
"o.x.z": {
"type": "string",
"boost": 2
}
}
}
}
The string mapping for o.x.z
is ignored and it becomes a date
.
Interestingly if we had mapped it as an integer
e.g
"o.x.z": {
"type": "integer",
"ignore_malformed": false
}
and indexed the following document
{
"o" : {
"x" : {
"y" : "this is analyzed",
"z" : "asdasda"
}
}
}
we DO get a NumberFormatException[For input string: \"asdasda\"]
. Something is out of sync here.
Regardless of the field name/path resolution fixes it would be very handy if we'd get a mapping exception whenever we try to map a field with dots in it to prevent ambiguous mappings.