Highlight not working with script_score query?

Highlights are not working script_score query in elasticsearch version 7.13. Please suggest

Welcome to our community! :smiley:

Unfortunately you haven't provided much information to work with here.
What is your query? What does your data look like? Can you provide a simple replication so we can test?

This is my query, I am getting the result but I am not getting the highlights.

{
  "_source": {"excludes": ["tag","document_vector"]},
  "query": {
    "script_score": {
      "query": {
        "match_all": {}
      },
      "script": {
        "source": "cosineSimilarity(params.query_vector, 'document_vector') + 1.0",
        "params": {
          "query_vector": query_vector
        }
      }
    }
  },
  "sort": [
    {
      "_score": {
        "order": "desc"
      }
    }
  ],
  "highlight": {
    "order": "score",
    "number_of_fragments": 3,
    "fragment_size": 150,
    "pre_tags": [
      "<mark>"
    ],
    "post_tags": [
      "</mark>"
    ],
    "fields": {
      "content": {}
    }
  }

Hi, Is there any update on it.

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