# How to set the "Fields" which only contain the matched?

**URL:** https://discuss.elastic.co/t/how-to-set-the-fields-which-only-contain-the-matched/34294
**Category:** Elasticsearch
**Created:** [November 11, 2015, 2:02am UTC](https://discuss.elastic.co/t/how-to-set-the-fields-which-only-contain-the-matched/34294 "2015-11-11T02:02:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![greenSnot](https://avatars.discourse-cdn.com/v4/letter/g/c67d28/32.png) [@greenSnot](https://discuss.elastic.co/u/greenSnot)
#### Post date: [November 11, 2015, 2:02am UTC](https://discuss.elastic.co/t/how-to-set-the-fields-which-only-contain-the-matched/34294/1 "2015-11-11T02:02:54Z")

</div>

{  
name:"bach",  
introduction:"bwv1004"  
works:[  
{work\_name:"bach bwv1004"},  
{work\_name:"bach violin concerto"}  
]  
}

I expect to get following answer when searching "bwv"  
{  
introduction:"bwv1004",  
works:[  
{work\_name:"bach bwv1004"}  
]  
}

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [November 11, 2015, 6:18am UTC](https://discuss.elastic.co/t/how-to-set-the-fields-which-only-contain-the-matched/34294/2 "2015-11-11T06:18:14Z")

</div>

It looks like `works` is an array, I'm not sure you can just return part of that in a query though.

---

<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 5, 2017, 11:39pm UTC](https://discuss.elastic.co/t/how-to-set-the-fields-which-only-contain-the-matched/34294/3 "2017-07-05T23:39:20Z")

</div>


