title: Elasticsearch scoring explanation not the same as practical scoring function
body: <p>From <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/practical-scoring-function.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/guide/current/practical-scoring-function.html</a> we have the following function for calculating the score.</p>
  
  <pre><code>score(q,d)  =  
              queryNorm(q)  
            · coord(q,d)    
            · ∑ (           
                  tf(t in d)   
                · idf(t)²      
                · t.getBoost() 
                · norm(t,d)    
              ) (t in q) 
  </code></pre>
  
  <p>However when looking at example below the explanation there seem to be some inconsistencies.
  1) Explanation shows only idf not idf².</p>
  
  <p>2) Where is the coordination factor?</p>
  
  <p>3) From the explanation, score seems to be calculated by: (tf * idf * fieldNorm) + (number of clauses * boost * queryNorm)</p>
  
  <p>Indexed Doc:</p>
  
  <pre><code>PUT test/type/1
  {
    "text": "a b c"
  }
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>GET test/type/_search
  {
    "explain":"true",
    "query": {
      "match": {
        "text": "a"
      }
    }
  }
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>{
    "took": 5,
    "timed_out": false,
    "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
    },
    "hits": {
      "total": 1,
      "max_score": 0.15342641,
      "hits": [
        {
          "_shard": 3,
          "_node": "5QvbXVlRSku-p_g81ZXpjQ",
          "_index": "test",
          "_type": "type",
          "_id": "1",
          "_score": 0.15342641,
          "_source": {
            "text": "a b c"
          },
          "_explanation": {
            "value": 0.15342641,
            "description": "sum of:",
            "details": [
              {
                "value": 0.15342641,
                "description": "weight(text:a in 0) [PerFieldSimilarity], result of:",
                "details": [
                  {
                    "value": 0.15342641,
                    "description": "fieldWeight in 0, product of:",
                    "details": [
                      {
                        "value": 1,
                        "description": "tf(freq=1.0), with freq of:",
                        "details": [
                          {
                            "value": 1,
                            "description": "termFreq=1.0",
                            "details": []
                          }
                        ]
                      },
                      {
                        "value": 0.30685282,
                        "description": "idf(docFreq=1, maxDocs=1)",
                        "details": []
                      },
                      {
                        "value": 0.5,
                        "description": "fieldNorm(doc=0)",
                        "details": []
                      }
                    ]
                  }
                ]
              },
              {
                "value": 0,
                "description": "match on required clause, product of:",
                "details": [
                  {
                    "value": 0,
                    "description": "# clause",
                    "details": []
                  },
                  {
                    "value": 3.2588913,
                    "description": "_type:type, product of:",
                    "details": [
                      {
                        "value": 1,
                        "description": "boost",
                        "details": []
                      },
                      {
                        "value": 3.2588913,
                        "description": "queryNorm",
                        "details": []
                      }
                    ]
                  }
                ]
              }
            ]
          }
        }
      ]
    }
  }
  </code></pre>