Hi.
First of all, Here is the query...
GET /my_doc/_search
{
"query": {
"function_score": {
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "keyword",
"fields": ["title^3", "content^1"],
"tie_breaker": 0.3
}
}
],
"filter": [
{
"terms": {
"company": ["John Doe"]
}
}
]
}
}
}
},
"highlight": {
"order": "score",
"fields": {
"title": {},
"content": {}
}
},
"track_scores": true,
"from": 0,
"size": 10
}
Once I search with this query, there are highlighted values in the results.
And I just want to know this highlighted value's start position and end position in the original document. I am just wondering is it possible and if it's possible let me know how to get it.
And the other question is that how to filter returned results with _score value.
Forexamle, This is a result.
"hits": [
{
"_index": "my_doc",
"_id": "11194",
"_score": 31.323647,
....
},
{
"_index": "my_doc",
"_id": "10560",
"_score": 12.19738,
....
},
{
"_index": "my_doc",
"_id": "12849",
"_score": 11.530414,
....
},
And I want to filter with _score value range. (_score <=10 && _score<=20)
If it's possible let me know how to write query please.
Thanks in advance.
Have a good day