# Nested json queries

**URL:** <https://discuss.elastic.co/t/nested-json-queries/5596>\
**Category:** Elasticsearch\
**Created:** [October 13, 2011, 7:55pm UTC](https://discuss.elastic.co/t/nested-json-queries/5596 "2011-10-13T19:55:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Terenzio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matthew_terenzio/32/2807_2.png) [@Matthew\_Terenzio](https://discuss.elastic.co/u/Matthew_Terenzio)\
**Post date:** [October 13, 2011, 7:55pm UTC](https://discuss.elastic.co/t/nested-json-queries/5596/1 "2011-10-13T19:55:51Z")

</div>

I have some data being indexed that follows a pattern like this:

{  
"[http://www.thehour.com/story/511535/frank-fay-way-we-were](http://www.thehour.com/story/511535/frank-fay-way-we-were)" : {  
"[http://iptc.org/std/rNews/2011-05-17#headline](http://iptc.org/std/rNews/2011-05-17#headline)" : [  
{ "value" : "Frank Fay: Way We Were", "type" : "literal" }  
],  
"[http://iptc.org/std/rNews/2011-05-17#dateCreated](http://iptc.org/std/rNews/2011-05-17#dateCreated)" : [  
{ "value" : "2011-09-22", "type" : "literal" }  
],  
"[http://iptc.org/std/rNews/2011-05-17#body](http://iptc.org/std/rNews/2011-05-17#body)" : [  
{ "value" : " Robert Burgess, 15-year executive director of NEON, is  
given . . .", "type" : "literal", "datatype" : "  
[http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral](http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral)" }  
]  
}  
}

Trying to wrap my head around the DSL query building. Would I need to  
flatten this out in order to construct a query for the dateCreated like  
this:

curl -XGET '[http://localhost:9200/test/item/\_search](http://localhost:9200/test/item/_search)' -d '{"query" : {"text"  
: {"http%3A%2F%[2Fiptc.org](http://2Fiptc.org)%2Fstd%2FrNews%2F2011-05-17%23dateCreated" :  
"2011-10-07"} }}'

or is it possible to drill down into the nested structure above?

Thanks.

---

<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:** [July 6, 2017, 3:52am UTC](https://discuss.elastic.co/t/nested-json-queries/5596/2 "2017-07-06T03:52:02Z")

</div>

Closed on July 6, 2017, 3:52am UTC


