# Filters and no scoring

**URL:** <https://discuss.elastic.co/t/filters-and-no-scoring/6823>\
**Category:** Elasticsearch\
**Created:** [February 28, 2012, 5:32am UTC](https://discuss.elastic.co/t/filters-and-no-scoring/6823 "2012-02-28T05:32:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei/32/2856_2.png) [@Andrei](https://discuss.elastic.co/u/Andrei)\
**Post date:** [February 28, 2012, 5:32am UTC](https://discuss.elastic.co/t/filters-and-no-scoring/6823/1 "2012-02-28T05:32:18Z")

</div>

I'm trying to understand the note in the docs that says the filter  
don't do any scoring. I've just tested a filtered query and I got back  
non-uniform scores. Can I rely on these scores for relevancy measure  
or am I missing something here? Using 0.19.0RC3.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [February 28, 2012, 9:57am UTC](https://discuss.elastic.co/t/filters-and-no-scoring/6823/2 "2012-02-28T09:57:16Z")

</div>

On Mon, 2012-02-27 at 21:32 -0800, Andrei Zmievski wrote:

> I'm trying to understand the note in the docs that says the filter  
> don't do any scoring. I've just tested a filtered query and I got back  
> non-uniform scores. Can I rely on these scores for relevancy measure  
> or am I missing something here? Using 0.19.0RC3.

Note: you say a "filtered query", so the query part DOES do scoring.  
Just the filter part doesn't.

If you used a constant\_score query, then all your docs would have the  
same score: 1

{ "query": {  
"constant\_score": {  
"filter": { "term": { "foo": 1 }}  
}  
}  
}

clint

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrei/32/2856_2.png) [@Andrei](https://discuss.elastic.co/u/Andrei)\
**Post date:** [February 29, 2012, 1:29am UTC](https://discuss.elastic.co/t/filters-and-no-scoring/6823/3 "2012-02-29T01:29:12Z")

</div>

On Feb 28, 4:57 am, Clinton Gormley [cl...@traveljury.com](mailto:cl...@traveljury.com) wrote:

> Note: you say a "filtered query", so the query part DOES do scoring.  
> Just the filter part doesn't.
> 
> If you used a constant\_score query, then all your docs would have the  
> same score: 1
> 
> { "query": {  
> "constant\_score": {  
> "filter": { "term": { "foo": 1 }}  
> }  
> }  
> }

Okay, I was confused because a couple of messages on this board said  
that you can't use filtered queries if you want to order by the score.  
Good to know I can.

-Andrei

---

<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 6, 2017, 3:37am UTC](https://discuss.elastic.co/t/filters-and-no-scoring/6823/4 "2017-07-06T03:37:57Z")

</div>


