# Scores not consistent between environments

**URL:** <https://discuss.elastic.co/t/scores-not-consistent-between-environments/40740>\
**Category:** Elasticsearch\
**Created:** [February 2, 2016, 2:21pm UTC](https://discuss.elastic.co/t/scores-not-consistent-between-environments/40740 "2016-02-02T14:21:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dnd/32/7539_2.png) [@dnd](https://discuss.elastic.co/u/dnd)\
**Post date:** [February 2, 2016, 2:21pm UTC](https://discuss.elastic.co/t/scores-not-consistent-between-environments/40740/1 "2016-02-02T14:21:04Z")

</div>

I have a very simple person name search that is returning different scores in different environments. Let's say my search in both environments is for `Lori Jefferies`. In my test environment, this scores the results as I am expecting and of the three users I have: Lori Jefferies, Lori Packer, and Lori Polca, jefferies is scored highest because of the two fields matching.

In my production environment, however, all users score exactly the same, even though Lori Jefferies matches both fields. This gist shows the results with explanation in both environments.

> <https://gist.github.com/dnd/4c8fa89fe10aeb1511b5>

There are probably about 40 matching users total in production, but I don't understand why Lori Jefferies is not scored as the highest, and ranked as such since even in the production explanation it shows both the first\_name and last\_name match.

My query is a pretty simple `{"multi_match":{"query":"lori jefferies","fields":["email","first_name","last_name","phone"]}}`

Any help would be appreciated.

Thanks,  
Steve

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 2, 2016, 5:25pm UTC](https://discuss.elastic.co/t/scores-not-consistent-between-environments/40740/2 "2016-02-02T17:25:11Z")

</div>

It appears that your two environments differ greatly on the number of  
documents contained. Is your environment sharded? All your hits come from  
the same shard, so I am assuming it is not. Production has over a million  
documents, while test only six (in the shard containing the hits).

Because of the increased volume on production, the idf for the last\_name  
field is not scored as highly as on development. Since the default behavior  
of multi\_match is best\_field, it will execute a dismax query underneath,  
always favoring the first name.

For more consistent behavior, try to index more content on development to  
further influence the IDF. Try playing around with the multi\_match  
settings, perhaps opting for cross\_fields.

Cheers,

Ivan

---

<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:19pm UTC](https://discuss.elastic.co/t/scores-not-consistent-between-environments/40740/3 "2017-07-05T23:19:31Z")

</div>

Closed on July 5, 2017, 11:19pm UTC


