# TermsQuery sine ES6.0 - with scoring

**URL:** <https://discuss.elastic.co/t/termsquery-sine-es6-0-with-scoring/135366>\
**Category:** Elasticsearch\
**Created:** [June 11, 2018, 12:52pm UTC](https://discuss.elastic.co/t/termsquery-sine-es6-0-with-scoring/135366 "2018-06-11T12:52:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jse](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@Jse](https://discuss.elastic.co/u/Jse)\
**Post date:** [June 11, 2018, 12:52pm UTC](https://discuss.elastic.co/t/termsquery-sine-es6-0-with-scoring/135366/1 "2018-06-11T12:52:14Z")

</div>

Hi,  
I would like to ask for help about a behavior change between 5.6 and 6.0 ES version

With ES 5.6, when I use a TermsQuery (without constant\_score) a score is computed  
Since 6.0 the score is not computed (even without constant\_score)  
Since 6.0 ES termsquery is transformed to Lucene TermInSetQuery

Query sample:

> GET /myindex/\_search  
> {  
> "query" : {  
> "terms" : {  
> "MYFIELD" : {["val1","val2","val3"]  
> }  
> }  
> }  
> }

Is there a way to still use a TermsQuery with score computation ??? or have I to write my own TermsQueryBuilder??  
Any suggestions.???.. In advance Thanks

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [June 11, 2018, 1:31pm UTC](https://discuss.elastic.co/t/termsquery-sine-es6-0-with-scoring/135366/2 "2018-06-11T13:31:04Z")

</div>

You have to use a bool query with an array of `should` clauses - each being a `term` (singular) query.

---

<div class="post-metadata">

**Author:** ![Jse](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@Jse](https://discuss.elastic.co/u/Jse)\
**Post date:** [June 11, 2018, 3:53pm UTC](https://discuss.elastic.co/t/termsquery-sine-es6-0-with-scoring/135366/3 "2018-06-11T15:53:19Z")

</div>

Thanks,

indeed for my previous sample it's not heavy to use a bool query but my real usecase is with a TermsLookup

```
 GET /myindex/_search
 {
 	"query" : {
       "terms" : {
         "MYFIELD" : {
           "index": "memory", "type" : "memory",
           "path" : "words", "id" : "1"
         }
       }
 	}
 }

```

The values are store inside a document of memory index

---

<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 9, 2018, 3:53pm UTC](https://discuss.elastic.co/t/termsquery-sine-es6-0-with-scoring/135366/4 "2018-07-09T15:53:33Z")

</div>

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