# ElasticSearch highlight not working as expected (after upgrade)

**URL:** <https://discuss.elastic.co/t/elasticsearch-highlight-not-working-as-expected-after-upgrade/79233>\
**Category:** Elasticsearch\
**Created:** [March 20, 2017, 10:44am UTC](https://discuss.elastic.co/t/elasticsearch-highlight-not-working-as-expected-after-upgrade/79233 "2017-03-20T10:44:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashokraj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashokraj/32/16506_2.png) [@ashokraj](https://discuss.elastic.co/u/ashokraj)\
**Post date:** [March 20, 2017, 10:44am UTC](https://discuss.elastic.co/t/elasticsearch-highlight-not-working-as-expected-after-upgrade/79233/1 "2017-03-20T10:44:24Z")

</div>

I have ES query,  
"query" : "lib/img\_folder/abc.png" for which the response is  
in 1.x : _lib_/_img\_folder_/_abc.png_  
in 2.x : _lib_/img\_folder/_abc.png_.

The expected output is as in 1.x. Please help figuring this out.  
Thanks in advance.

The entire query for reference:

{  
"query" : {  
"bool" : {  
"must" : {  
"function\_score" : {  
"query" : {  
"function\_score" : {  
"query" : {  
"query\_string" : {  
"query" : "lib/img\_folder/abc.png",  
"fields" : ["desc"]  
}  
},  
"functions" : [ {  
"filter" : {  
"query\_string" : {  
"query" : "lib/img\_folder/abc.png",  
"default\_operator" : "and"  
}  
},  
"weight" : 10.0  
} ]  
}  
},  
"functions" : []  
}  
}  
}  
},  
"highlight" : {  
"fields" : {  
"desc" : { }  
}  
}  
}

---

<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:** [April 17, 2017, 10:44am UTC](https://discuss.elastic.co/t/elasticsearch-highlight-not-working-as-expected-after-upgrade/79233/2 "2017-04-17T10:44:29Z")

</div>

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