# Need to get matched fields from document on querying

**URL:** <https://discuss.elastic.co/t/need-to-get-matched-fields-from-document-on-querying/87534>\
**Category:** Elasticsearch\
**Created:** [May 30, 2017, 9:19am UTC](https://discuss.elastic.co/t/need-to-get-matched-fields-from-document-on-querying/87534 "2017-05-30T09:19:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srinivas\_555](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@Srinivas\_555](https://discuss.elastic.co/u/Srinivas_555)\
**Post date:** [May 30, 2017, 9:19am UTC](https://discuss.elastic.co/t/need-to-get-matched-fields-from-document-on-querying/87534/1 "2017-05-30T09:19:21Z")

</div>

Hi All,

I need to get only matched fields from returned document on search.

Here is my sample index:  
{  
"\_index": "company",  
"\_type": "data",  
"\_id": "1",  
"\_version": 1,  
"found": true,  
"\_source": {  
"cpn": "companycpn",  
"cpn\_desc": "\_NA",  
"mpn": "2-020 TFE\_Tri",  
"commodity\_name": "\_NA",  
"sub\_commodity\_name": "HARDWARE & MISC",  
"manufacturer\_name": "PARKER HANNIFIN",  
"supplier\_name": "ABCDE",  
"product\_name": "NA",  
"product\_description": "NA",  
"product\_family\_name": "NA",  
"cm\_odm\_name": "CRF",  
"fiscal\_year": "2015",  
"fiscal\_quarter": "1"  
}  
}

Here is the GET query which I am using:  
GET company/data/\_search  
{  
"query": {

```
"query_string": {
  "query": "*parker*"
}

```

},  
"size": 10  
}

If you observe for the above query the matched field 'manufacturer\_name' in \_source. I need to get only this field, i.e I want to get only matched fields for the given query from elasticsearch.

Is there any way for this ?

Thanks,  
Srinivas

---

<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:** [June 27, 2017, 9:19am UTC](https://discuss.elastic.co/t/need-to-get-matched-fields-from-document-on-querying/87534/2 "2017-06-27T09:19:55Z")

</div>

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