# Getting doc\_count as zero while aggregation query on index created with type LocalDate in jpa

**URL:** <https://discuss.elastic.co/t/getting-doc-count-as-zero-while-aggregation-query-on-index-created-with-type-localdate-in-jpa/252885>\
**Category:** Elasticsearch\
**Created:** [October 21, 2020, 6:34pm UTC](https://discuss.elastic.co/t/getting-doc-count-as-zero-while-aggregation-query-on-index-created-with-type-localdate-in-jpa/252885 "2020-10-21T18:34:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daviddavid](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@daviddavid](https://discuss.elastic.co/u/daviddavid)\
**Post date:** [October 21, 2020, 6:34pm UTC](https://discuss.elastic.co/t/getting-doc-count-as-zero-while-aggregation-query-on-index-created-with-type-localdate-in-jpa/252885/1 "2020-10-21T18:34:08Z")

</div>

Getting doc\_count as zero while aggregation query on index created with type LocalDate in jpa java. Format is "yyyy-mm-dd". Whatever I try looking here and there as help , doc\_count is coming 0. Olease help  
Below is query:

{  
"aggs": {  
"dateaggregationrange": {  
"date\_range": {  
"field": "dateAggregation.keyword",  
"ranges": [  
{  
"from": "2010-09-25",  
"to": "2020-09-25"  
}  
]  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 22, 2020, 9:55am UTC](https://discuss.elastic.co/t/getting-doc-count-as-zero-while-aggregation-query-on-index-created-with-type-localdate-in-jpa/252885/2 "2020-10-22T09:55:39Z")

</div>

Please provide a fully reproducible example that contains the exact HTTP calls to create the index plus mapping (especially for the date field), some sample documentsas well as the full query, so that others can reproduce your problem.

Also specifying your elastic stack version would help a lot. See also [https://www.elastic.co/help](https://www.elastic.co/help)

---

<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:** [November 19, 2020, 9:56am UTC](https://discuss.elastic.co/t/getting-doc-count-as-zero-while-aggregation-query-on-index-created-with-type-localdate-in-jpa/252885/3 "2020-11-19T09:56:00Z")

</div>

Closed on November 19, 2020, 9:56am UTC

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