Hi @Mark_Harwood,
I have applied a workaround for this scenario.
Below is the query
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"query_string": {
"query": "\"Hello World\"",
"fields": [],
"phrase_slop": 1
}
}
]
}
},
{
"bool": {
"must_not": [
{
"query_string": {
"query": "\"Hello World\"",
"fields": []
}
}
]
}
}
]
}
}
}
This is working fine, but there is one issue that I am getting.
Suppose there is string = "Hello test World Hello" in an index.
Then the above query is highlighting Hello test World and also last Hello.
I do not want to highlight the last Hello because it does not contain World after phrase_slop: 1.
Is there any way to handle this scenario?