title: Elasticsearch simple term query gives strange scores
body: <p>Elasticsearch version: 5.0.2</p>
  
  <p>I populate my index with:</p>
  
  <pre><code>{_id: 1, tags: ['plop', 'plip', 'plup']},
  {_id: 2, tags: ['plop', 'plup']},
  {_id: 3, tags: ['plop']},
  {_id: 4, tags: ['plap', 'plep']},
  {_id: 5, tags: ['plop', 'plip', 'plup']},
  {_id: 6, tags: ['plup', 'plip']},
  {_id: 7, tags: ['plop', 'plip']}
  </code></pre>
  
  <p>Then, I would like to retrieve the max relevant rows for tags <code>plop</code> and <code>plip</code>:</p>
  
  <pre><code>query: {
    bool: {
      should: [
        {term: {tags: {value:'plop', _name: 'plop'}}},
        {term: {tags: {value:'plip', _name: 'plip'}}}
      ]
    }
  }
  </code></pre>
  
  <p>which is equivalent to (but I used the former one to debug):</p>
  
  <pre><code>query: {
    bool: {
      should: [
        {terms: {tags: ['plop', 'plip']}}
      ]
    }
  }
  </code></pre>
  
  <p>Then, I find really strange scores:</p>
  
  <pre><code>[
    { id: '2', score: 0.88002616, tags: [ 'plop', 'plup' ] },
    { id: '6', score: 0.88002616, tags: [ 'plup', 'plip' ] },
    { id: '5', score: 0.5063205, tags: [ 'plop', 'plip', 'plup' ] },
    { id: '7', score: 0.3610978, tags: [ 'plop', 'plip' ] },
    { id: '1', score: 0.29277915, tags: [ 'plop', 'plip', 'plup' ] },
    { id: '3', score: 0.2876821, tags: [ 'plop' ] }
  ]
  </code></pre>
  
  <p>Here is the detail of the response:</p>
  
  <pre><code>{
    "took": 1,
    "timed_out": false,
    "_shards": {
      "total": 5,
      "successful": 5,
      "failed": 0
    },
    "hits": {
      "total": 6,
      "max_score": 0.88002616,
      "hits": [
        {
          "_index": "myindex",
          "_type": "mytype",
          "_id": "2",
          "_score": 0.88002616,
          "_source": {
            "tags": [
              "plop",
              "plup"
            ]
          },
          "matched_queries": [
            "plop"
          ]
        },
        {
          "_index": "myindex",
          "_type": "mytype",
          "_id": "6",
          "_score": 0.88002616,
          "_source": {
            "tags": [
              "plup",
              "plip"
            ]
          },
          "matched_queries": [
            "plip"
          ]
        },
        {
          "_index": "myindex",
          "_type": "mytype",
          "_id": "5",
          "_score": 0.5063205,
          "_source": {
            "tags": [
              "plop",
              "plip",
              "plup"
            ]
          },
          "matched_queries": [
            "plop",
            "plip"
          ]
        },
        {
          "_index": "myindex",
          "_type": "mytype",
          "_id": "7",
          "_score": 0.3610978,
          "_source": {
            "tags": [
              "plop",
              "plip"
            ]
          },
          "matched_queries": [
            "plop",
            "plip"
          ]
        },
        {
          "_index": "myindex",
          "_type": "mytype",
          "_id": "1",
          "_score": 0.29277915,
          "_source": {
            "tags": [
              "plop",
              "plip",
              "plup"
            ]
          },
          "matched_queries": [
            "plop",
            "plip"
          ]
        },
        {
          "_index": "myindex",
          "_type": "mytype",
          "_id": "3",
          "_score": 0.2876821,
          "_source": {
            "tags": [
              "plop"
            ]
          },
          "matched_queries": [
            "plop"
          ]
        }
      ]
    }
  }
  </code></pre>
  
  <p>So, two questions:</p>
  
  <ol>
  <li>Why a row maching only one query (id 2 and 6) have a better score than one matching two (id 1, 5 and 7)?</li>
  <li>Why two rows having the same tags can have different scores? (id 1 and 5)</li>
  </ol>
  
  <p>Did I miss something?</p>