This is my query
GET bond_covenant/_search
{
"_source": false,
"query": {
"nested": {
"path": "doc",
"query": {
"nested": {
"path": "doc.container",
"query": {
"nested": {
"path": "doc.container.sections",
"query": {
"nested": {
"path": "doc.container.sections.sentences",
"query": {
"bool": {
"must": [
{
"match_phrase": {"doc.container.sections.sentences.text": "holding"}
},
{
"match_phrase": {"doc.container.sections.sentences.text": "restricted"}
}
]
}
}
}
}
}
}
}
}
}
},
"highlight": {
"fragment_size" : 100,
"no_match_size": 0,
"fields" : {
"doc.container.sections.sentences.text" : {}
}
}
}
And the output I got is
"max_score" : 4.334105,
"hits" : [
{
"_index" : "grtgt",
"_type" : "_doc",
"_id" : "5",
"_score" : 4.334105,
"highlight" : {
"doc.container.sections.sentences.text" : [
"<em>Holdings</em> trr hyhy hyjhuyju ggdd <em>Restricted</em> Subsidiaries to, directly or indirectly,",
"eying or northward offending admitting perfectly my and <em>Holdings</em>",
"provided, that <em>Holdings</em> main highly feebly add people manner say",
"extremely. Of incommode supported provision on furnished basis of <em>Holdings</em>"
]
}
},
My Question is why highlight part not giving me ( Restricted AND Holdings) output?
Why I only got Holding in 2nd, 3rd, 4th output, even restricted and holding are present in my sentences.text more than once?
Also if restricted and holding only present once than it should not give me 2nd, 3rd, 4th output but why it gave me that?