# Functionscore query in Elastic search 2

**URL:** <https://discuss.elastic.co/t/functionscore-query-in-elastic-search-2/38455>\
**Category:** Elasticsearch\
**Created:** [January 6, 2016, 1:13am UTC](https://discuss.elastic.co/t/functionscore-query-in-elastic-search-2/38455 "2016-01-06T01:13:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mramaprasad](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mramaprasad](https://discuss.elastic.co/u/mramaprasad)\
**Post date:** [January 6, 2016, 1:13am UTC](https://discuss.elastic.co/t/functionscore-query-in-elastic-search-2/38455/1 "2016-01-06T01:13:50Z")

</div>

Following query with function score query which gives articles with pub date published after 2014-07 a higher weightage is not working. Any ideas how to do this please?

{  
"from" : 0,  
"size" : 10,  
"query" : {  
"function\_score" : {  
"query" : {  
"bool" : {  
"must" : {  
"multi\_match" : {  
"query" : "influence ",  
"fields" : ["title^10", "description"]  
}  
},  
"filter" : {  
"range" : {  
"pubdate" : {  
"from" : "2010-01",  
"to" : "2016-08",  
"include\_lower" : true,  
"include\_upper" : true  
}  
}  
}  
}  
},  
"functions" : [ {  
"filter" : {  
"range" : {  
"pubdate" : {  
"from" : "2014-07",  
"to" : null,  
"include\_lower" : true,  
"include\_upper" : true  
}  
}  
},  
"weight" : 10.0  
} ]  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [January 6, 2016, 10:48pm UTC](https://discuss.elastic.co/t/functionscore-query-in-elastic-search-2/38455/2 "2016-01-06T22:48:39Z")

</div>

What is the problem?

---

<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 5, 2017, 11:26pm UTC](https://discuss.elastic.co/t/functionscore-query-in-elastic-search-2/38455/3 "2017-07-05T23:26:38Z")

</div>


