Highlighting with fuzziness in multi_match lose one char

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"
}
}
}

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

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'>

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

I can try. Thanks.

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