# Function\_Score Filter on \_ttl

**URL:** <https://discuss.elastic.co/t/function-score-filter-on--ttl/19545>\
**Category:** Elasticsearch\
**Created:** [September 1, 2014, 9:12am UTC](https://discuss.elastic.co/t/function-score-filter-on--ttl/19545 "2014-09-01T09:12:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fabian\_Kostring](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fabian_kostring/32/1310_2.png) [@Fabian\_Kostring](https://discuss.elastic.co/u/Fabian_Kostring)\
**Post date:** [September 1, 2014, 9:12am UTC](https://discuss.elastic.co/t/function-score-filter-on--ttl/19545/1 "2014-09-01T09:12:31Z")

</div>

Hey there!  
I have a function\_score query and i try to get only documents with a ttl  
greater than or equals a specific value.  
But it seems that the query doesnt work. I dont get the expected results.

GET index1/\_search  
{  
"query": {  
"function\_score": {  
"filter":{  
"bool": {  
"must": [  
{  
"range": {  
"\_ttl": {  
"gte" : 87105050  
}  
}  
}  
]  
}  
}  
}  
}  
}

In my results there are documents which have a ttl lower then 87105050. How  
can this happen?

--  
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/6cf09a91-7b0e-48cc-8d82-cf8726c1f63f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6cf09a91-7b0e-48cc-8d82-cf8726c1f63f%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:05am UTC](https://discuss.elastic.co/t/function-score-filter-on--ttl/19545/2 "2017-07-06T01:05:13Z")

</div>

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


