Unable to get value from nested field


(Bruno Zeraik) #1

I have the following mapping:

{
  "products": {
    "mappings": {
      "product": {
        "properties": {
          "search_data": {
            "type": "nested",
            "properties": {
              "sku_master": {
                "type": "keyword"
              },
            }
          }
        }
      }
    }
  }
}

I'm trying to query using script_score based on sku_master field, but the values always return nil

{
  "query": {
    "function_score": {
      "query": {
        ...
      },
      "score_mode": "sum",
      "boost_mode": "replace",
      "script_score": {
        "script": {         
          "source": """
            Debug.explain(doc["search_data.sku_master"])
          """
        }
      }
    }    
  }
}

Is something related to nested fields?

Elasticsearch version: 6.2.4


(system) #2

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