# Search within nested json data

**URL:** <https://discuss.elastic.co/t/search-within-nested-json-data/78660>\
**Category:** Elasticsearch\
**Created:** [March 15, 2017, 8:59am UTC](https://discuss.elastic.co/t/search-within-nested-json-data/78660 "2017-03-15T08:59:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pranil\_Ambule](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pranil_ambule/32/16208_2.png) [@Pranil\_Ambule](https://discuss.elastic.co/u/Pranil_Ambule)\
**Post date:** [March 15, 2017, 8:59am UTC](https://discuss.elastic.co/t/search-within-nested-json-data/78660/1 "2017-03-15T08:59:22Z")

</div>

How do i search within nested json without knowing the mapping.  
I can do the search using this.

```
	{
"query": {
	    "match" : {
    	     "doc.Header.To": "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"
	    }
    }
}

```

But how to do search with just the key(To) without using([doc.Header.To](http://doc.Header.To))  
and just get the content of key rather than the whole document.

---

<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:** [April 12, 2017, 8:59am UTC](https://discuss.elastic.co/t/search-within-nested-json-data/78660/2 "2017-04-12T08:59:43Z")

</div>

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