Fast Vector Highlighting is not working stable on Synonym based fields

Here , we are using Fast Vector highlight on a field where it has the copy field for synonym . for some records FVH highlights properly but for some it is not.
Field mapping:

title: {
type: "text",
term_vector: "with_positions_offsets",
copy_to: [
"title_synonym"
]
},
title_synonym: {
type: "text",
term_vector: "with_positions_offsets",
analyzer: "index_analyzer",
search_analyzer: "synonym_analyzer"
},

analyzer:

index_analyzer: {
filter: [
"lowercase",
"asciifolding"
],
type: "custom",
tokenizer: "standard"
}
synonym_analyzer: {
filter: [
"lowercase",
"synonymfile",
"asciifolding"
],
type: "custom",
tokenizer: "whitespace"
}
synonymfile: {
updateable: "true",
expand: "true",
type: "synonym_graph",
synonyms_path: "analysis/synonym.txt"
}

synonym.txt:
SMP , Sample and Information

Hi @Pavithra2014,

Welcome to the community! Can you give a bit more detail on a particular example which is not working for you? I assume by not working you mean it's not highlighting a particular section of text as you expect?

Hi Carly ,
I'm using "title" field alone in the highlight query but the results that are fetched are impacted with its copy field "titile_synonym" where synonym is implemented. i want only exact query term to be highlighted not the synonym of the query term . how to do this. i'm using ES 7.6.1 version

highlight query:

 "highlight": {
    "fragmenter": "span",
    "number_of_fragments": 2,
    "fragment_size": 250,
    "encoder": "html",
    "pre_tags": [
      "<b style='background-color: #d2d2d2;'>"
    ],
    "post_tags": [
      "</b>"
    ],
    "fields": {
      "title": {
        "type": "fvh"
      }
    },
    "require_field_match": false
  }

7.6.1 is EOL and no longer supported. Please upgrade ASAP.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

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