# Highlight not Working

**URL:** <https://discuss.elastic.co/t/highlight-not-working/3838>\
**Category:** Elasticsearch\
**Created:** [January 29, 2011, 1:09pm UTC](https://discuss.elastic.co/t/highlight-not-working/3838 "2011-01-29T13:09:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arulkumar](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Arulkumar](https://discuss.elastic.co/u/Arulkumar)\
**Post date:** [January 29, 2011, 1:09pm UTC](https://discuss.elastic.co/t/highlight-not-working/3838/1 "2011-01-29T13:09:18Z")

</div>

Hi all,  
Here i am search using the range query, i am getting the  
result of 8 records but i am not getting the result with highlight for  
all documents. Here 2 record's gets higlighted others not get  
highlighted.

Search Query:

{ "sort" : [ {"\_score" : {"reverse" :true } }, {"myfield1" :  
{"reverse" :false } } ] ,"query" : { "bool" : { "must" : [{ "bool" :  
{ "should" : [{ "has\_child" : {"type" : "included", "query" :  
{ "term" : { "\_included": "status2status" } }} }] } } ,{ "bool" :  
{ "should" : [{ "bool" : { "should" : [{ "range" : { "myfield1" :  
{ "from" : "01", "to" : "08","include\_lower" : true,"include\_upper" :  
true,"boost" : 1.0 } } } ,{ "bool" : { "must\_not" : [{ "bool" :  
{ "should" : [{ "query\_string" : { "default\_field" : "myfield1",  
"query" : "myfield1:\*","default\_operator" : "OR","analyzer" :  
"standard","allow\_leading\_wildcard" :  
true,"lowercase\_expanded\_terms" : true,"enable\_position\_increments" :  
true,"fuzzy\_prefix\_length" : 0,"fuzzy\_min\_sim" : 0.5,"phrase\_slop" :  
0,"boost" : 1.0 } }] } }] } }] } }] } }] } }, "from" : 0, "size" :  
20,"highlight" : { "tags\_schema" : "styled" ,"pre\_tags" :  
["_"] ,"post\_tags" : ["_"] ,"fields" : { "myfield1" :  
{"number\_of\_fragments" : 0 },"explain" : false,"fields" :["myfield1"] }

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [January 29, 2011, 1:54pm UTC](https://discuss.elastic.co/t/highlight-not-working/3838/2 "2011-01-29T13:54:20Z")

</div>

Which version of ES are you using? There was a bug that data was not being highlighted properly. Can you create a simple test case and see if it happens with master?  
On Saturday, January 29, 2011 at 3:09 PM, Arulkumar wrote:

> Hi all,  
> Here i am search using the range query, i am getting the  
> result of 8 records but i am not getting the result with highlight for  
> all documents. Here 2 record's gets higlighted others not get  
> highlighted.
> 
> Search Query:
> 
> { "sort" : [ {"\_score" : {"reverse" :true } }, {"myfield1" :  
> {"reverse" :false } } ] ,"query" : { "bool" : { "must" : [{ "bool" :  
> { "should" : [{ "has\_child" : {"type" : "included", "query" :  
> { "term" : { "\_included": "status2status" } }} }] } } ,{ "bool" :  
> { "should" : [{ "bool" : { "should" : [{ "range" : { "myfield1" :  
> { "from" : "01", "to" : "08","include\_lower" : true,"include\_upper" :  
> true,"boost" : 1.0 } } } ,{ "bool" : { "must\_not" : [{ "bool" :  
> { "should" : [{ "query\_string" : { "default\_field" : "myfield1",  
> "query" : "myfield1:\*","default\_operator" : "OR","analyzer" :  
> "standard","allow\_leading\_wildcard" :  
> true,"lowercase\_expanded\_terms" : true,"enable\_position\_increments" :  
> true,"fuzzy\_prefix\_length" : 0,"fuzzy\_min\_sim" : 0.5,"phrase\_slop" :  
> 0,"boost" : 1.0 } }] } }] } }] } }] } }] } }, "from" : 0, "size" :  
> 20,"highlight" : { "tags\_schema" : "styled" ,"pre\_tags" :  
> ["_"] ,"post\_tags" : ["_"] ,"fields" : { "myfield1" :  
> {"number\_of\_fragments" : 0 },"explain" : false,"fields" :["myfield1"] }

---

<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/highlight-not-working/3838/3 "2017-07-06T04:13:09Z")

</div>

Closed on July 6, 2017, 4:13am UTC


