# Custom\_filters\_score query performance

**URL:** <https://discuss.elastic.co/t/custom-filters-score-query-performance/16414>\
**Category:** Elasticsearch\
**Created:** [March 18, 2014, 5:29am UTC](https://discuss.elastic.co/t/custom-filters-score-query-performance/16414 "2014-03-18T05:29:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![venku123](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@venku123](https://discuss.elastic.co/u/venku123)\
**Post date:** [March 18, 2014, 5:29am UTC](https://discuss.elastic.co/t/custom-filters-score-query-performance/16414/1 "2014-03-18T05:29:01Z")

</div>

An Elasticsearch filtered query with a custom filter score query is  
expected to do scoring process for the documents returned by the filter.  
Instead the custom filter score query was fetching all documents and  
evaluating each of those document against the filter set.

I did some analysis and have found the reasons for this behavior. I have  
documented my findings in the under mentioned link. Hope this will benefit  
those using custom\_filters\_score query.

> **[Elasticsearch custom\_filters\_score query performance](http://readmytechstuff.blogspot.com/)**
>
> Elasticsearch custom\_filters\_score query performance

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9b3980d5-e0c6-43b6-8c61-2d42ebbfa257%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9b3980d5-e0c6-43b6-8c61-2d42ebbfa257%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 31, 2014, 6:56am UTC](https://discuss.elastic.co/t/custom-filters-score-query-performance/16414/2 "2014-03-31T06:56:47Z")

</div>

Hey

minor note: the custom\_filters\_score is deprecated and replaced by function  
score, see

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

In that context a filter may only be used for identifiying documents to be  
applied to the function score instead of filtering before, so make sure you  
are settings your filters correctly in order to not execute the function  
score over each document.

--Alex

On Tue, Mar 18, 2014 at 6:29 AM, [venku123@gmail.com](mailto:venku123@gmail.com) wrote:

> An Elasticsearch filtered query with a custom filter score query is  
> expected to do scoring process for the documents returned by the filter.  
> Instead the custom filter score query was fetching all documents and  
> evaluating each of those document against the filter set.
> 
> I did some analysis and have found the reasons for this behavior. I have  
> documented my findings in the under mentioned link. Hope this will benefit  
> those using custom\_filters\_score query.
> 
> [http://readmytechstuff.blogspot.com/](http://readmytechstuff.blogspot.com/)
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/9b3980d5-e0c6-43b6-8c61-2d42ebbfa257%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9b3980d5-e0c6-43b6-8c61-2d42ebbfa257%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/9b3980d5-e0c6-43b6-8c61-2d42ebbfa257%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9b3980d5-e0c6-43b6-8c61-2d42ebbfa257%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8zrrkSHpP\_btCD3ovHNAhj1fDo9rsw5OBLhmyHCFCJGw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8zrrkSHpP_btCD3ovHNAhj1fDo9rsw5OBLhmyHCFCJGw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:39am UTC](https://discuss.elastic.co/t/custom-filters-score-query-performance/16414/3 "2017-07-06T01:39:36Z")

</div>


