Explanation API Clarification

Take this output of the explanation API:

"explanations": [
{
"index": "my_index",
"valid": true,
"explanation": "(title:brown title:fox) (body:brown body:fox)"
}
]

Am I right in thinking the syntax in the explanation field is explaining how "scores" will be calculated rather than how matches are made? So in this case it's saying add the scores from each field where there is a match for brown or fox in all the specified fields?

Whereas in this instance it saying only add the score from one of the matched fields

"explanations": [
{
"index": "my_index",
"valid": true,
"explanation": "(title:brown +title:fox) | (body:brown body:fox)"
}
]

The Explain API is to describe how queries are translated to Lucene Query Syntax. So, generally speaking, it is to describe how matches are made and not how scores are calculated.

If you want to check how scores are calculated then you need to set explain: true in a search query body.

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