# Scoring inconsistency across shards

**URL:** <https://discuss.elastic.co/t/scoring-inconsistency-across-shards/33063>\
**Category:** Elasticsearch\
**Created:** [October 27, 2015, 10:58am UTC](https://discuss.elastic.co/t/scoring-inconsistency-across-shards/33063 "2015-10-27T10:58:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunnrajagopalan](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@arunnrajagopalan](https://discuss.elastic.co/u/arunnrajagopalan)\
**Post date:** [October 27, 2015, 10:58am UTC](https://discuss.elastic.co/t/scoring-inconsistency-across-shards/33063/1 "2015-10-27T10:58:22Z")

</div>

Hi , I am trying to run a like\_text query with tf set to false. I am seeing the queryNorm being inconsistent across shards. This is causing issues with sorting.  
**Here is my query :**

```
            {
                            "flt_field": {
                                    "identity.first_name": {
                                            "like_text": "mike",
                                            "ignore_tf": true
                                    }
                            }
        }, {
                            "flt_field": {
                                    "identity.last_name": {
                                            "like_text": "roger",
                                            "ignore_tf": true
                                    }
                            }
        } 

```

**Here are my results :**

```
                    "_shard": 3,
                    "_node": "NeAtgK8zT9GGDiRpql921Q",
                    "_index": "myindex",
                    "_type": "v1",
                    "_id": "226912189",
                    "_score": 0.76921964,
                    "fields": {
                            "identity.last_name": ["ROGER"],
                            "identity.first_name": ["MIKE"]
                    },
                    "_explanation": {
                            "value": 0.7692197,
                            "description": "sum of:",
                            "details": [ {
                                    "value": 0.04058554,
                                    "description": "ConstantScore(cache(internal.status.value:A)), product of:",
                                    "details": [ {
                                            "value": 1.0,
                                            "description": "boost"
      }, {
                                            "value": 0.04058554,
                                            "description": "queryNorm"
      } ]
    }
}, {
                    "_shard": 3,
                   ....
                  .... 
                    }
}, {
                    "_shard": 2,
                    "_node": "NeAtgK8zT9GGDiRpql921Q",
                    "_index": "myindex",
                    "_type": "v1",
                    "_id": "380786027",
                    "_score": 0.7689439,
                    "fields": {
                            "identity.last_name": ["ROGER"],
                            "identity.first_name": ["MIKE"]
                    },
                    "_explanation": {
                            "value": 0.76894397,
                            "description": "sum of:",
                            "details": [ {
                                    "value": 0.040466454,
                                    "description": "ConstantScore(cache(internal.status.value:A)), product of:",
                                    "details": [ {
                                            "value": 1.0,
                                            "description": "boost"
      }, {
                                            "value": 0.040466454,
                                            "description": "queryNorm"
      } ]
    }, {
                                    "value": 0.2910072,
                                    "description": "sum of:",
                                    "details": [ {
                                            "value": 0.2910072,
                                            "description": "ConstantScore(identity.first_name:mike)^7.1913195, product of:",
                                            "details": [ {
                                                    "value": 7.1913195,
                                                    "description": "boost"
        }, {
                                                    "value": 0.040466454,
                                                    "description": "queryNorm"
        } ]
      } ]
    }, ]
} ]
    }

```

}

Here you can see 3 records all having the same first name and last name . First two are from one shard and the third result is from a different shard. The score seems to vary even though the values are the same.

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [October 27, 2015, 11:49am UTC](https://discuss.elastic.co/t/scoring-inconsistency-across-shards/33063/2 "2015-10-27T11:49:51Z")

</div>

Hi,  
scoring is tricky, so just a few questions to better understand what you are trying to do. Do you have a special reason for you using the "Fuzzy Like This" query for what you are trying to archieve? And are you running this query on real data or using just a few documents as toy data?

In that later case it would help to know more about what kind and how many documents you are using. As for the `query_norm`, I think this scoring factor is calculated using IDF values which are not necessarily consistent across shards due to the distributed nature of Elasticsearch as explained [here](https://www.elastic.co/guide/en/elasticsearch/guide/current/relevance-is-broken.html). Have you tried using `search_type=dfs_query_then_fetch` and does it make any difference?

---

<div class="post-metadata">

**Author:** ![arunnrajagopalan](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@arunnrajagopalan](https://discuss.elastic.co/u/arunnrajagopalan)\
**Post date:** [October 27, 2015, 12:20pm UTC](https://discuss.elastic.co/t/scoring-inconsistency-across-shards/33063/3 "2015-10-27T12:20:59Z")

</div>

Hi,

I am querying against real data. To give you a idea, I am querying against a 16 node cluster and there are more than 10M records. Also like I mentioned earlier I am using search\_type=dfs\_query\_then\_fetch. I need to use the fuzzy\_like\_this query to get both exact matches and names that could be misspelled.

---

<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:** [July 5, 2017, 11:42pm UTC](https://discuss.elastic.co/t/scoring-inconsistency-across-shards/33063/4 "2017-07-05T23:42:26Z")

</div>


