Lets assume i want to perform this query
GET /_search
{
"query": {
"dis_max" : {
"queries" : [
{ "term" : { "title" : "Quick pets" }},
{ "term" : { "body" : "Quick pets" }}
],
"tie_breaker" : 0.7
}
}
}
According to the documentation of elasticsearch, this query returns a list of documents with the highest relevance score from any matching clause.
But how can i determine which underlying query caused the document to appear in the result list? How can i determine if a result appears due to query 1 or query 2 in the list of queries? Can i somehow return this for each result document?
You can use named queries
Query:
Result: