# Get only matched fields in highlight

**URL:** <https://discuss.elastic.co/t/get-only-matched-fields-in-highlight/3820>\
**Category:** Elasticsearch\
**Created:** [January 24, 2011, 3:58am UTC](https://discuss.elastic.co/t/get-only-matched-fields-in-highlight/3820 "2011-01-24T03:58:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibotty](https://avatars.discourse-cdn.com/v4/letter/i/4af34b/32.png) [@ibotty](https://discuss.elastic.co/u/ibotty)\
**Post date:** [January 24, 2011, 3:58am UTC](https://discuss.elastic.co/t/get-only-matched-fields-in-highlight/3820/1 "2011-01-24T03:58:23Z")

</div>

hi,

i'm pretty new to elasticsearch and like it so far. indexing and  
searching works wonderful!

for the one problem i have with it for now, i have searched for quiet  
some time, and it seems not possible (as far as i understood). i have  
some pretty easy documents stored (say: {"a" : "text", "b":  
"taxt" } ). for the moment i'm searching for them with a simple  
wildcard query: {"query": {"wildcard": {"\_all" :"text"}}, "highlight":  
{"fields": {"b" : {}, "a" : {}}}}

this returns:  
[...] "highlight" : {  
"a" : ["_text_"],  
"b" : [taxt]  
} [...]

i'd like to only get the matched field (here: "a").

i can hack around it, but i'd really like not to do this. so: is this  
possible, and if so, how?

thank you all for your work!  
ibotty

---

<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, 4:13am UTC](https://discuss.elastic.co/t/get-only-matched-fields-in-highlight/3820/2 "2017-07-06T04:13:21Z")

</div>


