# Match String required in Response using Query Match

**URL:** <https://discuss.elastic.co/t/match-string-required-in-response-using-query-match/202757>\
**Category:** Elasticsearch\
**Created:** [October 9, 2019, 3:55am UTC](https://discuss.elastic.co/t/match-string-required-in-response-using-query-match/202757 "2019-10-09T03:55:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek.tripathi](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@abhishek.tripathi](https://discuss.elastic.co/u/abhishek.tripathi)\
**Post date:** [October 9, 2019, 3:55am UTC](https://discuss.elastic.co/t/match-string-required-in-response-using-query-match/202757/1 "2019-10-09T03:55:49Z")

</div>

HI,  
I am using below query for searching record in Elastic Search:

{  
"query": {  
"match" : {  
"record" : {  
"query" : "black or ball OR Wheel OR bonnet",  
"fuzziness": "AUTO"  
}  
}  
}  
}

Result:

{  
"took": 4,  
"timed\_out": false,  
"\_shards": {  
"total": 5,  
"successful": 5,  
"skipped": 0,  
"failed": 0  
},  
"hits": {  
"total": {  
"value": 9,  
"relation": "eq"  
},  
"max\_score": 1.3177552,  
"hits": [  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "LOuLrm0ByPp6hZHAC8ln",  
"\_score": 1.3177552,  
"\_source": {  
"record": "Wheel"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "J-tWrm0ByPp6hZHAlsmm",  
"\_score": 0.6931472,  
"\_source": {  
"record": "Black Tire"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "KOtWrm0ByPp6hZHA9cn5",  
"\_score": 0.6931472,  
"\_source": {  
"record": "ball bearing"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "KetXrm0ByPp6hZHANMlw",  
"\_score": 0.6931472,  
"\_source": {  
"record": "bearing ball"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "LeuLrm0ByPp6hZHAQMlZ",  
"\_score": 0.6931472,  
"\_source": {  
"record": "Small Wheel"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "JutWrm0ByPp6hZHAZsma",  
"\_score": 0.52354836,  
"\_source": {  
"record": "Tire Black"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "KutXrm0ByPp6hZHAi8nk",  
"\_score": 0.34611148,  
"\_source": {  
"record": "Tire-Black D12 IN 23"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "LuuLrm0ByPp6hZHA3Mn3",  
"\_score": 0.2876821,  
"\_source": {  
"record": "bonnet"  
}  
},  
{  
"\_index": "myrecord",  
"\_type": "\_doc",  
"\_id": "K-tXrm0ByPp6hZHA4clE",  
"\_score": 0.23014566,  
"\_source": {  
"record": "Blcak"  
}  
}  
]  
}  
}

I need the match string (word) in the record result like:

```
           {
            "_index": "myrecord",
            "_type": "_doc",
            "_id": "KOtWrm0ByPp6hZHA9cn5",

            "matchString":"Ball"

            "_score": 0.6931472,
            "_source": {
                "record": "ball bearing"
            }
        }
```

---

<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:** [November 6, 2019, 3:55am UTC](https://discuss.elastic.co/t/match-string-required-in-response-using-query-match/202757/2 "2019-11-06T03:55:52Z")

</div>

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