# date\_histogram rounding and minimum\_number\_should\_match in filter not working

**URL:** <https://discuss.elastic.co/t/date-histogram-rounding-and-minimum-number-should-match-in-filter-not-working/8452>\
**Category:** Elasticsearch\
**Created:** [July 18, 2012, 4:59pm UTC](https://discuss.elastic.co/t/date-histogram-rounding-and-minimum-number-should-match-in-filter-not-working/8452 "2012-07-18T16:59:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sorostaran](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@Sorostaran](https://discuss.elastic.co/u/Sorostaran)\
**Post date:** [July 18, 2012, 4:59pm UTC](https://discuss.elastic.co/t/date-histogram-rounding-and-minimum-number-should-match-in-filter-not-working/8452/1 "2012-07-18T16:59:51Z")

</div>

We recently moved two indexes from our 0.18.7 cluster to our 0.19.3 cluster  
and  
date\_histogram with rounding such as "day:ceiling" no longer works.

{  
"size": 0,  
"query": {  
"match\_all": { }  
},  
"facets": {  
"uts": {  
"date\_histogram": {  
"field": "uts",  
"interval": "day:ceiling"  
}  
}  
}  
}

This works fine on our 0.18.7 cluster, but on our 0.19.3 cluster, we get

NumberFormatException[For input string: "day:ceiling"]

We tested this on a different index on our 0.19.8 cluster and got the same  
error. Without the rounding (just "day"  
etc.) it works on all three clusters.

* * *

Another issue we had with the index transfer was specifying  
minimum\_number\_should\_match in a bool filter, it works fine on our 0.18.7  
cluster, but gives an error on our 0.19.3 cluster. The setting works fine  
in a  
bool query on both clusters.

Help on this would be appreciated.

---

<div class="post-metadata">

**Author:** ![Mike](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mike](https://discuss.elastic.co/u/Mike)\
**Post date:** [September 17, 2012, 10:10pm UTC](https://discuss.elastic.co/t/date-histogram-rounding-and-minimum-number-should-match-in-filter-not-working/8452/2 "2012-09-17T22:10:53Z")

</div>

I'm getting the same issue with .19.8.

date\_histogram : {  
"field" : "date",  
"interval" : "day"  
}

Works ok, but chaning it to

date\_histogram : {  
"field" : "date",  
"interval" : "day:ceiling"  
}  
Fails with ElasticSearchParseException[Failed to parse [day:ceiling]];

On Wednesday, July 18, 2012 12:59:51 PM UTC-4, Sorostaran wrote:

> We recently moved two indexes from our 0.18.7 cluster to our 0.19.3  
> cluster and  
> date\_histogram with rounding such as "day:ceiling" no longer works.
> 
> {  
> "size": 0,  
> "query": {  
> "match\_all": { }  
> },  
> "facets": {  
> "uts": {  
> "date\_histogram": {  
> "field": "uts",  
> "interval": "day:ceiling"  
> }  
> }  
> }  
> }
> 
> This works fine on our 0.18.7 cluster, but on our 0.19.3 cluster, we get
> 
> NumberFormatException[For input string: "day:ceiling"]
> 
> We tested this on a different index on our 0.19.8 cluster and got the same  
> error. Without the rounding (just "day"  
> etc.) it works on all three clusters.
> 
> * * *
> 
> Another issue we had with the index transfer was specifying  
> minimum\_number\_should\_match in a bool filter, it works fine on our 0.18.7  
> cluster, but gives an error on our 0.19.3 cluster. The setting works fine  
> in a  
> bool query on both clusters.
> 
> Help on this would be appreciated.

--

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 18, 2012, 10:08am UTC](https://discuss.elastic.co/t/date-histogram-rounding-and-minimum-number-should-match-in-filter-not-working/8452/3 "2012-09-18T10:08:53Z")

</div>

Part of the work done in 0.19 to improve the date histogram behavior removed the option to specify the rounding method (and defaults to floor). Other values didn't make much sense to be honest, but if they do for you, would love to know. I will fix the docs to reflect the fact that its no longer available.

On Jul 18, 2012, at 6:59 PM, Sorostaran [steven@datafeedfile.com](mailto:steven@datafeedfile.com) wrote:

> We recently moved two indexes from our 0.18.7 cluster to our 0.19.3 cluster and  
> date\_histogram with rounding such as "day:ceiling" no longer works.
> 
> {  
> "size": 0,  
> "query": {  
> "match\_all": { }  
> },  
> "facets": {  
> "uts": {  
> "date\_histogram": {  
> "field": "uts",  
> "interval": "day:ceiling"  
> }  
> }  
> }  
> }
> 
> This works fine on our 0.18.7 cluster, but on our 0.19.3 cluster, we get
> 
> NumberFormatException[For input string: "day:ceiling"]
> 
> We tested this on a different index on our 0.19.8 cluster and got the same error. Without the rounding (just "day"  
> etc.) it works on all three clusters.
> 
> * * *
> 
> Another issue we had with the index transfer was specifying  
> minimum\_number\_should\_match in a bool filter, it works fine on our 0.18.7  
> cluster, but gives an error on our 0.19.3 cluster. The setting works fine in a  
> bool query on both clusters.
> 
> Help on this would be appreciated.

--

---

<div class="post-metadata">

**Author:** ![Mike](https://avatars.discourse-cdn.com/v4/letter/m/58f4c7/32.png) [@Mike](https://discuss.elastic.co/u/Mike)\
**Post date:** [September 19, 2012, 7:34pm UTC](https://discuss.elastic.co/t/date-histogram-rounding-and-minimum-number-should-match-in-filter-not-working/8452/4 "2012-09-19T19:34:41Z")

</div>

> Thanks for the reply. I only tested it out to see how my results would  
> change, so I didn't have a specific need for it.

--

---

<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, 3:12am UTC](https://discuss.elastic.co/t/date-histogram-rounding-and-minimum-number-should-match-in-filter-not-working/8452/5 "2017-07-06T03:12:14Z")

</div>


