# Filter results whose score is less than 2 std devs from mean; plugin, maybe?

**URL:** <https://discuss.elastic.co/t/filter-results-whose-score-is-less-than-2-std-devs-from-mean-plugin-maybe/7794>\
**Category:** Elasticsearch\
**Created:** [May 21, 2012, 10:24pm UTC](https://discuss.elastic.co/t/filter-results-whose-score-is-less-than-2-std-devs-from-mean-plugin-maybe/7794 "2012-05-21T22:24:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Woody\_Peterson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/woody_peterson/32/830_2.png) [@Woody\_Peterson](https://discuss.elastic.co/u/Woody_Peterson)\
**Post date:** [May 21, 2012, 10:24pm UTC](https://discuss.elastic.co/t/filter-results-whose-score-is-less-than-2-std-devs-from-mean-plugin-maybe/7794/1 "2012-05-21T22:24:00Z")

</div>

Through trial and error on my dataset I've found that results whose scores  
are less than two standard deviations from the mean score of a query are  
junk. This ticket [https://github.com/elasticsearch/elasticsearch/issues/719](https://github.com/elasticsearch/elasticsearch/issues/719)  
points out that in order to do anything like this you'd have to search  
twice, which is obviously wasteful.

Since I'm using a 3rd party library, tire, to access elasticsearch, it  
would be ideal if I could implement the functionality in a plugin that adds  
a score stats facet to queries, and does a simple iterative filter before  
returning the results. Although a bit hacky, I think it would be good  
enough, and possibly less work than rewriting/hacking tire.

I looked at the plugins docs page, and it's not clear whether this would be  
possible.

Thoughts? First steps?

Thanks for any help,

-Woody

---

<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:27am UTC](https://discuss.elastic.co/t/filter-results-whose-score-is-less-than-2-std-devs-from-mean-plugin-maybe/7794/2 "2017-07-06T03:27:45Z")

</div>

Closed on July 6, 2017, 3:27am UTC


