# Filter on duration in time\_frame filters?

**URL:** <https://discuss.elastic.co/t/filter-on-duration-in-time-frame-filters/75755>\
**Category:** Elasticsearch\
**Created:** [February 20, 2017, 2:47pm UTC](https://discuss.elastic.co/t/filter-on-duration-in-time-frame-filters/75755 "2017-02-20T14:47:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwkuster](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mwkuster](https://discuss.elastic.co/u/mwkuster)\
**Post date:** [February 20, 2017, 2:47pm UTC](https://discuss.elastic.co/t/filter-on-duration-in-time-frame-filters/75755/1 "2017-02-20T14:47:41Z")

</div>

The new time\_frame datatype and filters introduced in 5.2 ([https://www.elastic.co/guide/en/elasticsearch/reference/5.2/range.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/range.html)) allow for very convenient filters on intersects of date ranges, e.g. (inspired by the documentation):

GET range\_index/\_search  
{  
"query" : {  
"bool" : {  
"filter" : {  
"range" : {  
"time\_frame" : {  
"gte" : "2015-10-15",  
"lte" : "2015-11-10",  
"relation" : "intersects"  
}  
}  
}  
}  
}  
}

However, this only tells us that the two time frames intersect, not by how much. Is there any way existing or foreseen to also filter these intersects by minimum / maximum duration, let's say all time\_frames that intersect by at least 2 weeks (I couldn't find any, but might have overlooked the obvious)?

---

<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:** [March 20, 2017, 2:48pm UTC](https://discuss.elastic.co/t/filter-on-duration-in-time-frame-filters/75755/2 "2017-03-20T14:48:14Z")

</div>

Closed on March 20, 2017, 2:48pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
