Use the explain flag when a movie search returns relevance scores and you need to understand why one document ranked above another. Set "explain" to true in the search request body; Elasticsearch then returns the score calculation details. section 8.8.3 section 8.6.1
This focused request searches movie titles for “Lord” and asks Elasticsearch to explain each returned score; "_source": false keeps document fields out of the response. section 8.8.3
The response breaks the relevance score into components and describes how each was evaluated. The calculation includes inverse document frequency (IDF), term frequency (TF), and the boost factor, with details for the formulas’ variables. section 8.8.3
Investigating a missing movie match
Use the _explain endpoint for one document when the question concerns a specific match. A request for document 14 with a title match on “Lord” returns an explanation; when no term matches, the response reports "matched": false, a value of 0.0, and "no matching term". section 8.8.3
