# Elasticsearch filter query score

**URL:** <https://discuss.elastic.co/t/elasticsearch-filter-query-score/195715>\
**Category:** Elasticsearch\
**Created:** [August 19, 2019, 10:13am UTC](https://discuss.elastic.co/t/elasticsearch-filter-query-score/195715 "2019-08-19T10:13:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Callonski](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@Callonski](https://discuss.elastic.co/u/Callonski)\
**Post date:** [August 19, 2019, 10:13am UTC](https://discuss.elastic.co/t/elasticsearch-filter-query-score/195715/1 "2019-08-19T10:13:50Z")

</div>

Is there a way to get the score from a query with filter? Or do I need to restructure my query without filters?  
I would need a score between 0-1.

Now it looks like this:  
{  
"from": 0,  
"size": 10,  
"query": {  
"bool": {  
"must": {  
"bool": {  
"filter": [  
{  
"term": {  
"lastName.normalize": {  
"value": "Doe"  
}  
}  
},  
{  
"term": {  
"type.normalize": {  
"value": "Individual"  
}  
}  
}  
]  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [August 20, 2019, 12:18pm UTC](https://discuss.elastic.co/t/elasticsearch-filter-query-score/195715/2 "2019-08-20T12:18:26Z")

</div>

A filter by definition does not return a score. All you need to do in your query is change the `filter` into a `must`. You will get the exact same set of hits, but now with a score.

---

<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:** [September 17, 2019, 12:28pm UTC](https://discuss.elastic.co/t/elasticsearch-filter-query-score/195715/3 "2019-09-17T12:28:28Z")

</div>

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