# Multi value field different scoring for terms and terms\_set queries

**URL:** <https://discuss.elastic.co/t/multi-value-field-different-scoring-for-terms-and-terms-set-queries/278172>\
**Category:** Elasticsearch\
**Created:** [July 8, 2021, 10:24am UTC](https://discuss.elastic.co/t/multi-value-field-different-scoring-for-terms-and-terms-set-queries/278172 "2021-07-08T10:24:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zordark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zordark/32/80928_2.png) [@zordark](https://discuss.elastic.co/u/zordark)\
**Post date:** [July 8, 2021, 10:24am UTC](https://discuss.elastic.co/t/multi-value-field-different-scoring-for-terms-and-terms-set-queries/278172/1 "2021-07-08T10:24:28Z")

</div>

Good day,  
I have small question regarding scoring.  
I'm using example from documentation ([Terms query](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/query-dsl-terms-query.html)).  
If I query documents by multiple values with 'terms', like:

```auto
GET my-index-000001/_search?pretty
{
  "query": {
    "terms": {
      "color": ["blue", "green"]
    }
  }
}

```

all documents have score 1. Even some documents have more matches than others.  
But at the same time, query with terms\_set gives better scoring, and takes into account number of matches:

```auto
GET my-index-000001/_search?pretty
{
  "query": {
    "terms_set": {
      "color": {
       "terms" : ["blue", "green"],
       "minimum_should_match_script": {
          "source": "1"
        } 
      }
    }
  }
}

```

What is the difference between this 2 approaches from "scoring" POV  
Thank you in advance.

---

<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:** [August 5, 2021, 10:24am UTC](https://discuss.elastic.co/t/multi-value-field-different-scoring-for-terms-and-terms-set-queries/278172/2 "2021-08-05T10:24:58Z")

</div>

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