# Elasticsearch query on array of documents

**URL:** <https://discuss.elastic.co/t/elasticsearch-query-on-array-of-documents/19276>\
**Category:** Elasticsearch\
**Created:** [August 14, 2014, 5:15am UTC](https://discuss.elastic.co/t/elasticsearch-query-on-array-of-documents/19276 "2014-08-14T05:15:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![K\_Samanth\_Kumar\_Redd](https://avatars.discourse-cdn.com/v4/letter/k/e9c0ed/32.png) [@K\_Samanth\_Kumar\_Redd](https://discuss.elastic.co/u/K_Samanth_Kumar_Redd)\
**Post date:** [August 14, 2014, 5:15am UTC](https://discuss.elastic.co/t/elasticsearch-query-on-array-of-documents/19276/1 "2014-08-14T05:15:56Z")

</div>

Hi,

I am using elasticsearch for last 6 months. This is awesome framework.  
I am unable to search on array of documents.

ex:- Index documents

{  
cust\_name: "samanth"address: [{  
address1: "india hyderabad"  
},  
{  
address1: "india delhi"  
},  
{  
address1: "india chennai"  
},  
{  
address1: "india bangalore"  
}  
]  
}

{  
cust\_name: "Rama"address: [{  
address1: "india Kolkata"  
},  
{  
address1: "india bangalore"  
}  
]  
}

I want to search on "address1" field.

Can anybody help me on this?

Thanks & Regards,  
Samanth

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d3ffa90d-f49c-43dc-b128-d9c38a13a6f0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d3ffa90d-f49c-43dc-b128-d9c38a13a6f0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 14, 2014, 6:05am UTC](https://discuss.elastic.co/t/elasticsearch-query-on-array-of-documents/19276/2 "2014-08-14T06:05:49Z")

</div>

This does not look as correct JSON.

Could you gist a full SENSE script?

It will help to understand what you did so far and where is your issue.

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 14 août 2014 à 07:15, "K.Samanth Kumar Reddy" [samanthkumar.k@gmail.com](mailto:samanthkumar.k@gmail.com) a écrit :

Hi,

I am using elasticsearch for last 6 months. This is awesome framework.  
I am unable to search on array of documents.

ex:- Index documents

{  
cust\_name: "samanth"address: [{  
address1: "india hyderabad"  
},  
{  
address1: "india delhi"  
},  
{  
address1: "india chennai"  
},  
{  
address1: "india bangalore"  
}  
]  
}

{  
cust\_name: "Rama"address: [{  
address1: "india Kolkata"  
},  
{  
address1: "india bangalore"  
}  
]  
}

I want to search on "address1" field.

Can anybody help me on this?

## Thanks & Regards, Samanth

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d3ffa90d-f49c-43dc-b128-d9c38a13a6f0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d3ffa90d-f49c-43dc-b128-d9c38a13a6f0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/00281B3D-0C95-483F-BDDB-3241825F19EE%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/00281B3D-0C95-483F-BDDB-3241825F19EE%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:08am UTC](https://discuss.elastic.co/t/elasticsearch-query-on-array-of-documents/19276/3 "2017-07-06T01:08:43Z")

</div>


