# Search single array record

**URL:** <https://discuss.elastic.co/t/search-single-array-record/11697>\
**Category:** Elasticsearch\
**Created:** [April 25, 2013, 8:19pm UTC](https://discuss.elastic.co/t/search-single-array-record/11697 "2013-04-25T20:19:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric\_sanford](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@eric\_sanford](https://discuss.elastic.co/u/eric_sanford)\
**Post date:** [April 25, 2013, 8:19pm UTC](https://discuss.elastic.co/t/search-single-array-record/11697/1 "2013-04-25T20:19:37Z")

</div>

hello..

I have an array that looks like this...

"upcs": [  
{"id": "_CTL BR NTRL FNTN PRMS MZRL ASG PRVL RMN SIX CHS  
ITLN FNCY SHRD BAG 8 OZ 200469352962_"},  
{"id": "SRGN NTRL FNTN PRMS MZRL ASG PRVL RMN SIX CHS  
ITLN SHRD BAG 28 OZ 004610030098"},  
{"id": "CRYS FRM MNTR JCK PRMS MZRL ASG PRVL RMN PST GRLC  
SIX CHS ITLN FNLY SHRD 8 OZ 007592529995"},  
]

when i run a query like so...

"query":{ "match":{"upcs.id":"_ctl br ntrl fntn prms mzrl asg prvl rmn six  
chs itln fncy shrd bag 8 oz 200469352962_"} }

it correctly matches the record, but it returns the entire array

is it possible to only return the item in the array that was matched

Thank you

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [April 25, 2013, 8:21pm UTC](https://discuss.elastic.co/t/search-single-array-record/11697/2 "2013-04-25T20:21:57Z")

</div>

You can probably do that with highlighting

On Thu, Apr 25, 2013 at 11:19 PM, eric sanford \<[pcstechnologiesinc@gmail.com](mailto:pcstechnologiesinc@gmail.com)

> wrote:

> hello..
> 
> I have an array that looks like this...
> 
> "upcs": [  
> {"id": "_CTL BR NTRL FNTN PRMS MZRL ASG PRVL RMN SIX  
> CHS ITLN FNCY SHRD BAG 8 OZ 200469352962_"},  
> {"id": "SRGN NTRL FNTN PRMS MZRL ASG PRVL RMN SIX CHS  
> ITLN SHRD BAG 28 OZ 004610030098"},  
> {"id": "CRYS FRM MNTR JCK PRMS MZRL ASG PRVL RMN PST  
> GRLC SIX CHS ITLN FNLY SHRD 8 OZ 007592529995"},  
> ]
> 
> when i run a query like so...
> 
> "query":{ "match":{"upcs.id":"_ctl br ntrl fntn prms mzrl asg prvl rmn  
> six chs itln fncy shrd bag 8 oz 200469352962_"} }
> 
> it correctly matches the record, but it returns the entire array
> 
> is it possible to only return the item in the array that was matched
> 
> Thank you
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:39am UTC](https://discuss.elastic.co/t/search-single-array-record/11697/3 "2017-07-06T02:39:35Z")

</div>


