# Highlighting does not work with FLT

**URL:** <https://discuss.elastic.co/t/highlighting-does-not-work-with-flt/4784>\
**Category:** Elasticsearch\
**Created:** [July 5, 2011, 11:20pm UTC](https://discuss.elastic.co/t/highlighting-does-not-work-with-flt/4784 "2011-07-05T23:20:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raul\_Jr\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raul_jr_martinez/32/1286_2.png) [@Raul\_Jr\_Martinez](https://discuss.elastic.co/u/Raul_Jr_Martinez)\
**Post date:** [July 5, 2011, 11:20pm UTC](https://discuss.elastic.co/t/highlighting-does-not-work-with-flt/4784/1 "2011-07-05T23:20:18Z")

</div>

Hello,

The highlighting feature does not seem to work when I use Fuzzy Like  
This query. I'm not sure if the way I constructed the query is correct  
or not. Please point out to me what I'm missing in order for the  
highlighting feature to work?

Using "query\_string" the highlighting works --\> [https://gist.github.com/1065424](https://gist.github.com/1065424)

Using "flt" the highlighting is not working --\> [https://gist.github.com/1065403](https://gist.github.com/1065403)

Following are the mapping or articles and  
{  
"articles": {  
"properties": {  
"tags": {  
"index": "not\_analyzed",  
"type": "string"  
},  
"id": {  
"type": "string"  
},  
"content": {  
"store": "yes",  
"type": "string"  
},  
"dtmPosted": {  
"format": "yyyy-MM-dd HH:mm:ss",  
"type": "date"  
},  
"title": {  
"store": "yes",  
"type": "string"  
},  
"classId": {  
"type": "string"  
},  
"postedBy": {  
"index": "not\_analyzed",  
"type": "string"  
},  
"url": {  
"index": "not\_analyzed",  
"store": "yes",  
"type": "string"  
}  
}  
}  
}

{  
"adverts": {  
"properties": {  
"id": {  
"type": "string"  
},  
"content": {  
"store": "yes",  
"type": "string"  
},  
"dtmPosted": {  
"format": "yyyy-MM-dd HH:mm:ss",  
"type": "date"  
},  
"title": {  
"store": "yes",  
"type": "string"  
},  
"price": {  
"store": "yes",  
"null\_value": 0,  
"type": "double"  
},  
"keywords": {  
"index\_name": "keyword",  
"type": "string"  
},  
"classId": {  
"type": "string"  
},  
"postedBy": {  
"index": "not\_analyzed",  
"type": "string"  
},  
"categories": {  
"index": "not\_analyzed",  
"store": "yes",  
"type": "string"  
},  
"currency": {  
"index": "not\_analyzed",  
"store": "yes",  
"type": "string"  
}  
}  
}  
}

THank you

Raul

---

<div class="post-metadata">

**Author:** ![Nicolas\_Lalevee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicolas_lalevee/32/2892_2.png) [@Nicolas\_Lalevee](https://discuss.elastic.co/u/Nicolas_Lalevee)\
**Post date:** [July 7, 2011, 4:23pm UTC](https://discuss.elastic.co/t/highlighting-does-not-work-with-flt/4784/2 "2011-07-07T16:23:05Z")

</div>

I had some issue with a prefix query. It has been fixed with my patch:

> <https://github.com/elastic/elasticsearch/pull/1065>
>
> Prefix queries needs to be rewritten so the highlighter can work. So the pull re…quest.
> 
> The highlight of prefix queries doesn't highlight the prefix but the full word. I have written some code on the client side to change the highlighted words. For instance, searching "ski", lucene highlight "\<\>skiing\</\>", "\<\>skin\</\>" or "\<\>skills\</\>". So my code change the highlighted parts to be: "\<\>ski\</\>in", "\<\>ski\</\>n" or "\<\>ski\</\>lls". This code may be interesting to be on the server part, but I don't know where. If you think it is interesting, let me know.

Probably some patch will be needed for the fuzzy query.

Nicolas

Le 6 juil. 2011 à 01:20, rmartinez a écrit :

> Hello,
> 
> The highlighting feature does not seem to work when I use Fuzzy Like  
> This query. I'm not sure if the way I constructed the query is correct  
> or not. Please point out to me what I'm missing in order for the  
> highlighting feature to work?
> 
> Using "query\_string" the highlighting works --\> [highlighting works when "query\_string" is used. · GitHub](https://gist.github.com/1065424)
> 
> Using "flt" the highlighting is not working --\> [ElasticSearch's fuzzylikethis not highlighting.. · GitHub](https://gist.github.com/1065403)
> 
> Following are the mapping or articles and  
> {  
> "articles": {  
> "properties": {  
> "tags": {  
> "index": "not\_analyzed",  
> "type": "string"  
> },  
> "id": {  
> "type": "string"  
> },  
> "content": {  
> "store": "yes",  
> "type": "string"  
> },  
> "dtmPosted": {  
> "format": "yyyy-MM-dd HH:mm:ss",  
> "type": "date"  
> },  
> "title": {  
> "store": "yes",  
> "type": "string"  
> },  
> "classId": {  
> "type": "string"  
> },  
> "postedBy": {  
> "index": "not\_analyzed",  
> "type": "string"  
> },  
> "url": {  
> "index": "not\_analyzed",  
> "store": "yes",  
> "type": "string"  
> }  
> }  
> }  
> }
> 
> {  
> "adverts": {  
> "properties": {  
> "id": {  
> "type": "string"  
> },  
> "content": {  
> "store": "yes",  
> "type": "string"  
> },  
> "dtmPosted": {  
> "format": "yyyy-MM-dd HH:mm:ss",  
> "type": "date"  
> },  
> "title": {  
> "store": "yes",  
> "type": "string"  
> },  
> "price": {  
> "store": "yes",  
> "null\_value": 0,  
> "type": "double"  
> },  
> "keywords": {  
> "index\_name": "keyword",  
> "type": "string"  
> },  
> "classId": {  
> "type": "string"  
> },  
> "postedBy": {  
> "index": "not\_analyzed",  
> "type": "string"  
> },  
> "categories": {  
> "index": "not\_analyzed",  
> "store": "yes",  
> "type": "string"  
> },  
> "currency": {  
> "index": "not\_analyzed",  
> "store": "yes",  
> "type": "string"  
> }  
> }  
> }  
> }
> 
> THank you
> 
> Raul

---

<div class="post-metadata">

**Author:** ![Raul\_Jr\_Martinez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raul_jr_martinez/32/1286_2.png) [@Raul\_Jr\_Martinez](https://discuss.elastic.co/u/Raul_Jr_Martinez)\
**Post date:** [July 8, 2011, 12:28am UTC](https://discuss.elastic.co/t/highlighting-does-not-work-with-flt/4784/3 "2011-07-08T00:28:17Z")

</div>

Hello,

Apologies for not updating this thread. I fixed the highlighting issue  
by making sure to add at following parameters in "title" and  
"content"

term\_vector = with\_positions\_offsets

On Jul 8, 12:23 am, Nicolas Lalevée [nicolas.lale...@hibnet.org](mailto:nicolas.lale...@hibnet.org)  
wrote:

> I had some issue with a prefix query. It has been fixed with my patch:[https://github.com/elasticsearch/elasticsearch/pull/1065](https://github.com/elasticsearch/elasticsearch/pull/1065)
> 
> Probably some patch will be needed for the fuzzy query.
> 
> Nicolas
> 
> Le 6 juil. 2011 à 01:20, rmartinez a écrit :
> 
> > Hello,
> 
> > The highlighting feature does not seem to work when I use Fuzzy Like  
> > This query. I'm not sure if the way I constructed the query is correct  
> > or not. Please point out to me what I'm missing in order for the  
> > highlighting feature to work?
> 
> > Using "query\_string" the highlighting works --\>[highlighting works when "query\_string" is used. · GitHub](https://gist.github.com/1065424)
> 
> > Using "flt" the highlighting is not working --\>[ElasticSearch's fuzzylikethis not highlighting.. · GitHub](https://gist.github.com/1065403)
> 
> > Following are the mapping or articles and  
> > {  
> > "articles": {  
> > "properties": {  
> > "tags": {  
> > "index": "not\_analyzed",  
> > "type": "string"  
> > },  
> > "id": {  
> > "type": "string"  
> > },  
> > "content": {  
> > "store": "yes",  
> > "type": "string"  
> > },  
> > "dtmPosted": {  
> > "format": "yyyy-MM-dd HH:mm:ss",  
> > "type": "date"  
> > },  
> > "title": {  
> > "store": "yes",  
> > "type": "string"  
> > },  
> > "classId": {  
> > "type": "string"  
> > },  
> > "postedBy": {  
> > "index": "not\_analyzed",  
> > "type": "string"  
> > },  
> > "url": {  
> > "index": "not\_analyzed",  
> > "store": "yes",  
> > "type": "string"  
> > }  
> > }  
> > }  
> > }
> 
> > {  
> > "adverts": {  
> > "properties": {  
> > "id": {  
> > "type": "string"  
> > },  
> > "content": {  
> > "store": "yes",  
> > "type": "string"  
> > },  
> > "dtmPosted": {  
> > "format": "yyyy-MM-dd HH:mm:ss",  
> > "type": "date"  
> > },  
> > "title": {  
> > "store": "yes",  
> > "type": "string"  
> > },  
> > "price": {  
> > "store": "yes",  
> > "null\_value": 0,  
> > "type": "double"  
> > },  
> > "keywords": {  
> > "index\_name": "keyword",  
> > "type": "string"  
> > },  
> > "classId": {  
> > "type": "string"  
> > },  
> > "postedBy": {  
> > "index": "not\_analyzed",  
> > "type": "string"  
> > },  
> > "categories": {  
> > "index": "not\_analyzed",  
> > "store": "yes",  
> > "type": "string"  
> > },  
> > "currency": {  
> > "index": "not\_analyzed",  
> > "store": "yes",  
> > "type": "string"  
> > }  
> > }  
> > }  
> > }
> 
> > THank you
> 
> > Raul

---

<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:01am UTC](https://discuss.elastic.co/t/highlighting-does-not-work-with-flt/4784/4 "2017-07-06T04:01:22Z")

</div>


