# Highlighting with fuzziness in multi\_match lose one char

**URL:** <https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413>\
**Category:** Elasticsearch\
**Created:** [November 19, 2018, 5:31pm UTC](https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413 "2018-11-19T17:31:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![edoardo.zanon](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@edoardo.zanon](https://discuss.elastic.co/u/edoardo.zanon)\
**Post date:** [November 19, 2018, 5:31pm UTC](https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413/1 "2018-11-19T17:31:58Z")

</div>

Hello,  
I'm building a small research compoentent, but it will have to search through a lot of data.  
I made a multi\_match between different fields but with the fuzziness setting (1) to improve the search results, the highlight loses a letter.

Is it possible to avoid this?

QueryCode:

> "query": {  
> "bool": {  
> "must": [  
> {  
> "multi\_match": {  
> "query": "test12342",  
> "fields": [  
> "otherLocales.name.edge",  
> "locales.IT.name.edge",  
> "locales.EN.name.edge"  
> ],  
> "type": "best\_fields",  
> "fuzziness": "1",  
> "operator": "And"  
> }  
> },  
> {  
> "terms": {  
> "contentType": [  
> "ALL"  
> ]  
> }  
> }  
> ]  
> }  
> },  
> "highlight": {  
> "fields": {  
> "otherLocales.name.edge": {  
> "type": "fvh",  
> "order": "score"  
> },  
> "locales.IT.name.edge": {  
> "type": "fvh",  
> "order": "score"  
> },  
> "locales.EN.name.edge": {  
> "type": "fvh",  
> "order": "score"  
> }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![Jaspreet\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaspreet_singh/32/58296_2.png) [@Jaspreet\_Singh](https://discuss.elastic.co/u/Jaspreet_Singh)\
**Post date:** [November 20, 2018, 9:29pm UTC](https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413/2 "2018-11-20T21:29:49Z")

</div>

Can you show your documents, against what you are running you queries?  
It is a bit hard to tell without looking at the data.

---

<div class="post-metadata">

**Author:** ![edoardo.zanon](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@edoardo.zanon](https://discuss.elastic.co/u/edoardo.zanon)\
**Post date:** [November 21, 2018, 8:51am UTC](https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413/3 "2018-11-21T08:51:02Z")

</div>

Ah Sorry for my forgetfulness  
{  
otherLocales:[{  
name:"test12342",  
description:" test for autocomplete"  
}]  
locales:{  
"it":{  
name:"test12342 testa",  
description:" test for autocomplete"  
}  
}  
"id":"432pi-234po-4lk34lk-lk34j"  
}

the result of highlight is:  
\<em'\> test1234 \</em'\>

---

<div class="post-metadata">

**Author:** ![zz\_hello](https://avatars.discourse-cdn.com/v4/letter/z/3bc359/32.png) [@zz\_hello](https://discuss.elastic.co/u/zz_hello)\
**Post date:** [November 29, 2018, 7:55am UTC](https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413/4 "2018-11-29T07:55:49Z")

</div>

maybe you can remove "type": "fvh" in the highlight part, then you can get what you want

---

<div class="post-metadata">

**Author:** ![edoardo.zanon](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@edoardo.zanon](https://discuss.elastic.co/u/edoardo.zanon)\
**Post date:** [November 29, 2018, 8:33am UTC](https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413/5 "2018-11-29T08:33:14Z")

</div>

I can try. 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:** [December 27, 2018, 8:33am UTC](https://discuss.elastic.co/t/highlighting-with-fuzziness-in-multi-match-lose-one-char/157413/6 "2018-12-27T08:33:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
