# Highlighting bug in 0.90.0 and possibly 0.90.1?

**URL:** <https://discuss.elastic.co/t/highlighting-bug-in-0-90-0-and-possibly-0-90-1/12269>\
**Category:** Elasticsearch\
**Created:** [June 5, 2013, 1:00am UTC](https://discuss.elastic.co/t/highlighting-bug-in-0-90-0-and-possibly-0-90-1/12269 "2013-06-05T01:00:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![concept47](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@concept47](https://discuss.elastic.co/u/concept47)\
**Post date:** [June 5, 2013, 1:00am UTC](https://discuss.elastic.co/t/highlighting-bug-in-0-90-0-and-possibly-0-90-1/12269/1 "2013-06-05T01:00:29Z")

</div>

when using an nGram filter on a field, when trying to highlight said field  
in search results, elasticsearch highlights the entire word instead of just  
the query

so if I have the text "American" and I search for "rican"  
highlighting should look like this Ame_rican_  
but instead it does this _American_

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![concept47](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@concept47](https://discuss.elastic.co/u/concept47)\
**Post date:** [June 5, 2013, 3:21am UTC](https://discuss.elastic.co/t/highlighting-bug-in-0-90-0-and-possibly-0-90-1/12269/2 "2013-06-05T03:21:23Z")

</div>

Just follow the directions here [http://stackoverflow.com/a/15005321/141822](http://stackoverflow.com/a/15005321/141822)  
What you'll get back if you're using elasticsearch 0.90.0 and 0.90.1 is

{  
"took" : 11,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 1,  
"successful" : 1,  
"failed" : 0  
},  
"hits" : {  
"total" : 3,  
"max\_score" : 0.71231794,  
"hits" : [ {  
"\_index" : "myindex",  
"\_type" : "product",  
"\_id" : "0KyaIB8xRmqE-g0hl0ky6g",  
"\_score" : 0.71231794,  
"fields" : {  
"code" : "Samsung Galaxy i7500"  
},  
"highlight" : {  
"code.ngram" : ["_Samsung Galaxy i7500_"],  
"code" : ["_Samsung Galaxy i7500_"]  
}  
}, {  
"\_index" : "myindex",  
"\_type" : "product",  
"\_id" : "vZwpcBu0QAyGmP9LHz1hUA",  
"\_score" : 0.71231794,  
"fields" : {  
"code" : "Samsung Galaxy 5 Europa"  
},  
"highlight" : {  
"code.ngram" : ["_Samsung Galaxy 5 Europa_"],  
"code" : ["_Samsung Galaxy 5 Europa_"]  
}  
}, {  
"\_index" : "myindex",  
"\_type" : "product",  
"\_id" : "7sNkZAlxSlmuLZA9S68bvg",  
"\_score" : 0.71231794,  
"fields" : {  
"code" : "Samsung Galaxy Mini"  
},  
"highlight" : {  
"code.ngram" : ["_Samsung Galaxy Mini_"],  
"code" : ["_Samsung Galaxy Mini_"]  
}  
} ]  
}  
}

which is clearly not correct

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:32am UTC](https://discuss.elastic.co/t/highlighting-bug-in-0-90-0-and-possibly-0-90-1/12269/3 "2017-07-06T02:32:55Z")

</div>


