# Elasticsearch - EdgeNgram + highlight + term\_vector = bad highlights

**URL:** <https://discuss.elastic.co/t/elasticsearch-edgengram-highlight-term-vector-bad-highlights/8340>\
**Category:** Elasticsearch\
**Created:** [July 6, 2012, 1:40pm UTC](https://discuss.elastic.co/t/elasticsearch-edgengram-highlight-term-vector-bad-highlights/8340 "2012-07-06T13:40:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastien\_Lorber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sebastien_lorber/32/2551_2.png) [@Sebastien\_Lorber](https://discuss.elastic.co/u/Sebastien_Lorber)\
**Post date:** [July 6, 2012, 1:40pm UTC](https://discuss.elastic.co/t/elasticsearch-edgengram-highlight-term-vector-bad-highlights/8340/1 "2012-07-06T13:40:00Z")

</div>

Hello,

I've originally posted this question to StackOverflow but nobody answers  
so...

> <https://stackoverflow.com/questions/11303660/elasticsearch-edgengram-highlight-term-vector-bad-highlights>

When i use an analyzer with edgengram (min=3, max=7, front) +  
term\_vector=with\_positions\_offsets

With document having text = "CouchDB"

When i search for "couc"

## My highlight is on "cou" and not "couc"

It seems my highlight is only on the minimum matching token "cou" while i  
would expect to be on the whole word or at least the longest token found.

It works fine without analyzing the text with  
term\_vector=with\_positions\_offsets -\> the highlight is on "couc" and not  
"cou"

What's the impact of removing the term\_vector=with\_positions\_offsets for  
perfomances?

Thanks

---

<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, 3:21am UTC](https://discuss.elastic.co/t/elasticsearch-edgengram-highlight-term-vector-bad-highlights/8340/2 "2017-07-06T03:21:15Z")

</div>


