Skip to content

Strange behaviour of fields API with mixed object notation  #68215

Closed
@cbuescher

Description

@cbuescher

It appears we can currently index and retrieve documents with mixed object notation like this:

PUT my-index-000001/_doc/1
{
  "obj.products" : { "manufacturer" : "Supersoft" } ,
  "obj" : {
    "products" : 
       { "manufacturer" : "HyperSmart" }
  }
}

When searching on field obj.products.manufacturer we get a hit for both terms "Supersoft" and "HyperSmart".
However, the fields API output only returns second value:

POST /my-index-000001/_search
{
  "query": {
            "match": {
              "obj.products.manufacturer": "Supersoft"
            }
    },
  "_source" : false,
  "fields" : ["*"]
}

returns

       "fields" : {
          "obj.products.manufacturer.keyword" : [
            "HyperSmart"
          ],
          "obj.products.manufacturer" : [
            "HyperSmart"
          ]
        }

The same output is produced when searching for "HyperSmart". Tested on 7.10.0.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions