# How can i use range filter when i use tems\_stats

**URL:** <https://discuss.elastic.co/t/how-can-i-use-range-filter-when-i-use-tems-stats/15897>\
**Category:** Elasticsearch\
**Created:** [February 19, 2014, 1:06pm UTC](https://discuss.elastic.co/t/how-can-i-use-range-filter-when-i-use-tems-stats/15897 "2014-02-19T13:06:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![happyprg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/happyprg/32/681_2.png) [@happyprg](https://discuss.elastic.co/u/happyprg)\
**Post date:** [February 19, 2014, 1:06pm UTC](https://discuss.elastic.co/t/how-can-i-use-range-filter-when-i-use-tems-stats/15897/1 "2014-02-19T13:06:05Z")

</div>

i want to use below query..  
but, range filter is not working.  
it's impossible ?

{  
"size": "0",  
"query": {  
"match\_all": {}  
},  
"filter": {  
"range": {  
"created": {  
"from": %d,  
"to": %d  
}  
}  
},  
"facets": {  
"playUniqueId\_playTimeScore\_stats": {  
"terms\_stats": {  
"key\_field": "uniquePlayId",  
"value\_field": "playTimeScore",  
"size": "0"  
}  
}  
}  
}

//plz help me.  
i want to add range condition to the "tems\_stats" queries  
plz help me.

---

<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:49am UTC](https://discuss.elastic.co/t/how-can-i-use-range-filter-when-i-use-tems-stats/15897/2 "2017-07-06T01:49:09Z")

</div>

Closed on July 6, 2017, 1:49am UTC


