Term query on nested field returns empty result, why?

GET /at_de_elastic/_search
{
  "_source": [
    "attributes.articleName",
    "attributes.remoteId",
    "attributes.comparisonListMetadataSearch"
  ],
    "query": {
        "term": {
            "attributes.remoteId": {
                "value": "00770013",
                "boost": 1.0
            }
        }
    }
}

returns

{
  "hits" : {
    "total" : 1,
    "max_score" : 9.504323,
    "hits" : [
      {
        "_index" : "at_de_elastic-27",
        "_type" : "Product",
        "_id" : "3247218",
        "_score" : 9.504323,
        "_routing" : "3247218",
        "_source" : {
          "attributes" : {
            "articleName" : "Vergaser-Reparatursatz RK-23HS  anstelle von Tillotson",
            "comparisonListMetadataSearch" : [
              {
                "number" : "4153020",
                "name" : "Alpina",
                "normalizedNumber" : "4153020"
              }
            ],
            "remoteId" : "00770013"
          }
        }
      }
    ]
  }
}

Why does

GET /at_de_elastic/_search
{
    "query": {
        "term": {
            "attributes.comparisonListMetadataSearch.number": {
                "value": "4153020"
            }
        }
    }
}

return an empty result?

This is the relevant part of the mapping:

image

image

the field comparisonListMetadataSearch is configured is nested and thus also needs to be wrapped into a nested query, the remoteId is not (at least it is not listed).

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.