# Filter on score

**URL:** https://discuss.elastic.co/t/filter-on-score/14527
**Category:** Elasticsearch
**Created:** [November 21, 2013, 10:28pm UTC](https://discuss.elastic.co/t/filter-on-score/14527 "2013-11-21T22:28:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Joanna\_Kochaniak](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@Joanna\_Kochaniak](https://discuss.elastic.co/u/Joanna_Kochaniak)
#### Post date: [November 21, 2013, 10:28pm UTC](https://discuss.elastic.co/t/filter-on-score/14527/1 "2013-11-21T22:28:08Z")

</div>

Is there any way in ES to create a filter based on a document's score in  
some query? I know min\_score allows me to do this at the search request  
level, but I basically need that functionality at the filter level. If query  
filter[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-filter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-query-filter.html)had a min\_score parameter it would work. Or if a range  
filter[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-range-filter.html)let me use a document's score, not just fields.

Alternatively, is there any way to access the score in a script filter[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-script-filter.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-script-filter.html)?  
I've tried \_score, doc['\_score'].value, and doc.score, but none of these  
work.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:05am UTC](https://discuss.elastic.co/t/filter-on-score/14527/2 "2017-07-06T02:05:33Z")

</div>


