Rebuild highlight result

I'm trying to highlight my search results. i'm flowing this part of doc https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html

This is my elastic query :

"query" : {
    "match": { "title": "a" }
  },
  "highlight": {
    "pre_tags": [
      "<strong>"
    ],
    "post_tags": [
      "<strong>"
    ],
    "fields": {
      "title": {
        "fragment_size": 150,
        "number_of_fragments": 1
      }
    }
  },

Im' getting this kind of result:

"hits": [
       {
        ...
        "_source": {
            "title": "aut",
        },
        "highlight": {
            "title": [
                "<strong>aut<strong>"
            ]
        }
    },
...

I want to applie the heighlt to the result under the _source key. Is it possible to modify some configuration to have a result looks like this instead:

"hits": [
       {
        ...
        "_source": {
             "<strong>aut<strong>"
        }
    },
...

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