# Function score query filter cache does not work

**URL:** <https://discuss.elastic.co/t/function-score-query-filter-cache-does-not-work/18927>\
**Category:** Elasticsearch\
**Created:** [July 28, 2014, 9:09am UTC](https://discuss.elastic.co/t/function-score-query-filter-cache-does-not-work/18927 "2014-07-28T09:09:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_G\_Ortega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_g_ortega/32/46359_2.png) [@David\_G\_Ortega](https://discuss.elastic.co/u/David_G_Ortega)\
**Post date:** [July 28, 2014, 9:09am UTC](https://discuss.elastic.co/t/function-score-query-filter-cache-does-not-work/18927/1 "2014-07-28T09:09:42Z")

</div>

Hi!!

this works

{  
"query" :  
{  
"function\_score":  
{  
"score\_mode" : "first",  
"boost\_mode" : "replace",  
"query" :  
{  
"match\_all" : {}  
},  
"functions":  
[  
{  
"filter":  
{  
"query" :  
{  
"terms" :  
{  
"user" : ["kimchy"],  
"minimum\_should\_match" : 1  
}  
}  
},  
"script\_score":  
{  
"script" : "100"  
}  
}  
]  
}  
}  
}

this not

{  
"query" :  
{  
"function\_score":  
{  
"score\_mode" : "first",  
"boost\_mode" : "replace",  
"query" :  
{  
"match\_all" : {}  
},  
"functions":  
[  
{  
"filter":  
{  
"fquery" :  
{  
"query" :  
{  
"terms" :  
{  
"user" : ["kimchy"],  
"minimum\_should\_match" : 1  
}  
}  
},  
"\_cache" : true  
},  
"script\_score":  
{  
"script" : "100"  
}  
}  
]  
}  
}  
}

accoding to the  
documentation [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)  
this is how should be defined to use cache.  
Is this a bug? Do I have to open a ticket?

If not... how can we setup the filter cache?

Thanks

--  
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/54b802c6-5cd8-49a8-8828-f857418a813e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/54b802c6-5cd8-49a8-8828-f857418a813e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![David\_G\_Ortega](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/david_g_ortega/32/46359_2.png) [@David\_G\_Ortega](https://discuss.elastic.co/u/David_G_Ortega)\
**Post date:** [July 28, 2014, 2:58pm UTC](https://discuss.elastic.co/t/function-score-query-filter-cache-does-not-work/18927/2 "2014-07-28T14:58:07Z")

</div>

No one? Ok opening a ticket 😉

--  
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/667337c4-eed2-4942-a79d-18eaeaf90d84%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/667337c4-eed2-4942-a79d-18eaeaf90d84%40googlegroups.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:12am UTC](https://discuss.elastic.co/t/function-score-query-filter-cache-does-not-work/18927/3 "2017-07-06T01:12:46Z")

</div>


