# Java API - cannot use aggregation interval

**URL:** <https://discuss.elastic.co/t/java-api-cannot-use-aggregation-interval/209404>\
**Category:** Elasticsearch\
**Created:** [November 26, 2019, 2:23am UTC](https://discuss.elastic.co/t/java-api-cannot-use-aggregation-interval/209404 "2019-11-26T02:23:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![111247](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111247/32/58321_2.png) [@111247](https://discuss.elastic.co/u/111247)\
**Post date:** [November 26, 2019, 2:23am UTC](https://discuss.elastic.co/t/java-api-cannot-use-aggregation-interval/209404/1 "2019-11-26T02:23:22Z")

</div>

```
AggregationBuilder aggregationBuilder = AggregationBuilders.dateHistogram("hourly_aggs")
                            .field("recv_time")
                            .fixedInterval(DateHistogramInterval.HOUR);

```

When i run above java code, it throws exception.  
The content of log is

> [date\_histogram] unknown field [calendar\_interval], parser not found  
> I understood this as 'dateHistogram has not parser for fixedInterval type'

Is it a kind of bug?

---

<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:** [December 24, 2019, 2:23am UTC](https://discuss.elastic.co/t/java-api-cannot-use-aggregation-interval/209404/2 "2019-12-24T02:23:40Z")

</div>

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