# Unable to get value from nested field

**URL:** <https://discuss.elastic.co/t/unable-to-get-value-from-nested-field/138563>\
**Category:** Elasticsearch\
**Created:** [July 4, 2018, 1:12pm UTC](https://discuss.elastic.co/t/unable-to-get-value-from-nested-field/138563 "2018-07-04T13:12:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruno\_z](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bruno_z/32/61143_2.png) [@bruno\_z](https://discuss.elastic.co/u/bruno_z)\
**Post date:** [July 4, 2018, 1:12pm UTC](https://discuss.elastic.co/t/unable-to-get-value-from-nested-field/138563/1 "2018-07-04T13:12:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 1, 2018, 1:12pm UTC](https://discuss.elastic.co/t/unable-to-get-value-from-nested-field/138563/2 "2018-08-01T13:12:34Z")

</div>

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