# Highlight on Phrase Prefix Text Query

**URL:** <https://discuss.elastic.co/t/highlight-on-phrase-prefix-text-query/5082>\
**Category:** Elasticsearch\
**Created:** [August 8, 2011, 2:58pm UTC](https://discuss.elastic.co/t/highlight-on-phrase-prefix-text-query/5082 "2011-08-08T14:58:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)\
**Post date:** [August 8, 2011, 2:58pm UTC](https://discuss.elastic.co/t/highlight-on-phrase-prefix-text-query/5082/1 "2011-08-08T14:58:51Z")

</div>

Hi,

I am doing a PHRASE\_PREFIX TextQuery on a non-analysed field. But  
when I look for the highlights using:

highlightFieldsMap = hit.getHighlightFields()

I get nothing. My ES version is 16.2. Highlights for  
QueryStringQuery work fine.

Best Regards,

David.

---

<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:** [August 8, 2011, 4:36pm UTC](https://discuss.elastic.co/t/highlight-on-phrase-prefix-text-query/5082/2 "2011-08-08T16:36:58Z")

</div>

Can you try with 0.17? Do you have term vectors on the field you highlight?

On Mon, Aug 8, 2011 at 5:58 PM, davrob2 [daviroberts@gmail.com](mailto:daviroberts@gmail.com) wrote:

> Hi,
> 
> I am doing a PHRASE\_PREFIX TextQuery on a non-analysed field. But  
> when I look for the highlights using:
> 
> highlightFieldsMap = hit.getHighlightFields()
> 
> I get nothing. My ES version is 16.2. Highlights for  
> QueryStringQuery work fine.
> 
> Best Regards,
> 
> David.

---

<div class="post-metadata">

**Author:** ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)\
**Post date:** [August 10, 2011, 1:20pm UTC](https://discuss.elastic.co/t/highlight-on-phrase-prefix-text-query/5082/3 "2011-08-10T13:20:13Z")

</div>

Hi,

This seems to be working ok now, not sure why, I didn't change  
versions from 0.16.2. I'm using the normal highlighter, rather than  
setting "term\_vector" : "with\_positions\_offsets" in the mapping.

Will update this thread if I get to the bottom of the issue.

David.

On Aug 8, 5:36 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Can you try with 0.17? Do you have term vectors on the field you highlight?
> 
> On Mon, Aug 8, 2011 at 5:58 PM, davrob2 [davirobe...@gmail.com](mailto:davirobe...@gmail.com) wrote:
> 
> > Hi,
> 
> > I am doing a PHRASE\_PREFIX TextQuery on a non-analysed field. But  
> > when I look for the highlights using:
> 
> > highlightFieldsMap = hit.getHighlightFields()
> 
> > I get nothing. My ES version is 16.2. Highlights for  
> > QueryStringQuery work fine.
> 
> > Best Regards,
> 
> > David.

---

<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:57am UTC](https://discuss.elastic.co/t/highlight-on-phrase-prefix-text-query/5082/4 "2017-07-06T03:57:37Z")

</div>


