# How to use "aggs" query on BigDecimal-type data?

**URL:** <https://discuss.elastic.co/t/how-to-use-aggs-query-on-bigdecimal-type-data/131441>\
**Category:** Elasticsearch\
**Created:** [May 11, 2018, 9:01am UTC](https://discuss.elastic.co/t/how-to-use-aggs-query-on-bigdecimal-type-data/131441 "2018-05-11T09:01:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee-Think](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lee-think/32/31102_2.png) [@Lee-Think](https://discuss.elastic.co/u/Lee-Think)\
**Post date:** [May 11, 2018, 9:01am UTC](https://discuss.elastic.co/t/how-to-use-aggs-query-on-bigdecimal-type-data/131441/1 "2018-05-11T09:01:24Z")

</div>

Hi there, i want to store bigdecimal in elastisearch, but i found it's not be supported except convert the data to string or float, but if i do so, string will lead to the data can't be used for aggs; and float will lead to precision loss. Is there any solution?

---

<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:** [June 8, 2018, 9:01am UTC](https://discuss.elastic.co/t/how-to-use-aggs-query-on-bigdecimal-type-data/131441/2 "2018-06-08T09:01:27Z")

</div>

Closed on June 8, 2018, 9:01am UTC

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