Elasticsearch version (bin/elasticsearch --version):
~
Version: Tested 6.0 and 6.6
~
Plugins installed: none
JVM version (java -version):
~
java version "11.0.2" 2019-01-15 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)
~
OS version (uname -a if on a Unix-like system):
~
Darwin x.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
~
Description of the problem including expected versus actual behavior:
ES updates the mapping creating indexed fields where one should not when setting enabled to false property to the object field.
Steps to reproduce:
~~~
PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"name": {
"enabled": false
}
}
}
}
}
PUT my_index/_doc/1
{
"name.first": "john"
}
GET my_index/_mapping
{
"my_index" : {
"mappings" : {
"_doc" : {
"properties" : {
"name" : {
"enabled" : false,
"properties" : {
"first" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
}
}
}
DELETE my_index
PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"name": {
"enabled": false
}
}
}
}
}
PUT my_index/_doc/1
{
"name": {
"first": "john"
}
}
GET my_index/_mapping
{
"my_index" : {
"mappings" : {
"_doc" : {
"properties" : {
"name" : {
"type" : "object",
"enabled" : false
}
}
}
}
}
}
~~~
Pinging @elastic/es-search
Thank you @tamros for this bug report. I was able to reproduce the issue, and it looks like we are not properly checking the enabled flag when fields are specified in dot notation.
I'm looking into this :)