# Understanding Elasticsearch scoring between versions

**URL:** <https://discuss.elastic.co/t/understanding-elasticsearch-scoring-between-versions/211246>\
**Category:** Elasticsearch\
**Created:** [December 10, 2019, 8:36am UTC](https://discuss.elastic.co/t/understanding-elasticsearch-scoring-between-versions/211246 "2019-12-10T08:36:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robs24](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@robs24](https://discuss.elastic.co/u/robs24)\
**Post date:** [December 10, 2019, 8:36am UTC](https://discuss.elastic.co/t/understanding-elasticsearch-scoring-between-versions/211246/1 "2019-12-10T08:36:23Z")

</div>

We're currently in the midst of an upgrade from v5.2 to v6.8 and I'm seeing some noticeable differences in scoring of records during searches. I can't quite decide if there are possibly some deprecated features as part of the search that might be influencing the scoring results, and I'm wondering if anyone could maybe please take a quick look over an example query and see if I'm missing something? An explain shows minor differences in individual component scoring, but this is enough to breach a `min_score` threshold on a boolQuery and at times we're seeing almost double the amount of results come back from a search in v6.8 compared to the same search in v5.2.

```auto
{
  "from": 0,
  "size": 10,
  "query": {
     "bool": {
        "must": [
           {
              "bool": {
                 "should": [
                    {
                       "multi_match": {
                          "query": "Test",
                          "fields": [
                             "id_no^1.0",
                             "id_name^1.0"
                          ],
                          "type": "best_fields",
                          "operator": "OR",
                          "slop": 0,
                          "fuzziness": "2",
                          "prefix_length": 1,
                          "max_expansions": 50,
                          "lenient": false,
                          "zero_terms_query": "NONE",
                          "boost": 1
                       }
                    },
                    {
                      "match_phrase": {
                         "id_name": {
                            "query": "Test",
                            "slop": 2,
                            "boost": 1
                         }
                      }
                   },
                   {
                      "match": {
                         "ext_id": {
                            "query": "Test",
                            "operator": "OR",
                            "prefix_length": 0,
                            "max_expansions": 50,
                            "fuzzy_transpositions": true,
                            "lenient": false,
                            "zero_terms_query": "NONE",
                            "boost": 2.5
                         }
                      }
                   },
                   {
                      "match": {
                         "id_no": {
                            "query": "Test",
                            "operator": "OR",
                            "prefix_length": 0,
                            "max_expansions": 50,
                            "fuzzy_transpositions": true,
                            "lenient": false,
                            "zero_terms_query": "NONE",
                            "boost": 1
                         }
                      }
                   },
                   {
                      "match": {
                         "id_name": {
                            "query": "Test",
                            "operator": "OR",
                            "prefix_length": 0,
                            "max_expansions": 50,
                            "fuzzy_transpositions": true,
                            "lenient": false,
                            "zero_terms_query": "NONE",
                            "boost": 1
                         }
                      }
                   }
                 ],
                 "disable_coord": false,
                 "adjust_pure_negative": true,
                 "boost": 1
              }
           }
        ],
        "must_not": [
           {
              "exists": {
                 "field": "is_deleted",
                 "boost": 1
              }
           }
        ],
        "disable_coord": false,
        "adjust_pure_negative": true,
        "boost": 1
     }
  },
  "min_score": 7,
  "aggregations": {
     "type_desc": {
        "terms": {
           "field": "type_desc",
           "size": 25,
           "min_doc_count": 1,
           "shard_min_doc_count": 0,
           "show_term_doc_count_error": false,
           "order": [
              {
                 "_term": "asc"
              }
           ]
        }
     },
     "status_desc": {
        "terms": {
           "field": "status_desc",
           "size": 25,
           "min_doc_count": 1,
           "shard_min_doc_count": 0,
           "show_term_doc_count_error": false,
           "order": [
              {
                 "_term": "asc"
              }
           ]
        }
     },
     "ext_status_desc": {
        "terms": {
           "field": "ext_status_desc",
           "size": 25,
           "min_doc_count": 1,
           "shard_min_doc_count": 0,
           "show_term_doc_count_error": false,
           "order": [
              {
                 "_term": "asc"
              }
           ]
        }
     },
     "load_desc": {
        "terms": {
           "field": "load_desc",
           "size": 25,
           "min_doc_count": 1,
           "shard_min_doc_count": 0,
           "show_term_doc_count_error": false,
           "order": [
              {
                 "_term": "asc"
              }
           ]
        }
     }
  }
}

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 10, 2019, 12:38pm UTC](https://discuss.elastic.co/t/understanding-elasticsearch-scoring-between-versions/211246/2 "2019-12-10T12:38:46Z")

</div>

Take a look at [query explain](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/search-request-body.html#request-body-search-explain) and the [explain API](https://www.elastic.co/guide/en/elasticsearch/reference/7.5/search-explain.html), that might help to spot the differences a bit easier.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2020, 12:38pm UTC](https://discuss.elastic.co/t/understanding-elasticsearch-scoring-between-versions/211246/3 "2020-01-07T12:38:55Z")

</div>

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