# How to store big int value in elastic

**URL:** <https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391>\
**Category:** Elasticsearch\
**Created:** [December 22, 2020, 1:57pm UTC](https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391 "2020-12-22T13:57:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AKASH\_DUBEY1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akash_dubey1/32/80336_2.png) [@AKASH\_DUBEY1](https://discuss.elastic.co/u/AKASH_DUBEY1)\
**Post date:** [December 22, 2020, 1:57pm UTC](https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391/1 "2020-12-22T13:57:26Z")

</div>

what data type should be used for storing the given value `=281471798906391` .as it is out of long-range in java. and I have to use the range query on it. I tried using the keyword, double,it works but the range query doesn't please reply.

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [December 22, 2020, 2:13pm UTC](https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391/2 "2020-12-22T14:13:45Z")

</div>

Did you tried to map it as long in elasticsearch ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 22, 2020, 2:20pm UTC](https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391/3 "2020-12-22T14:20:34Z")

</div>

Have a look at this list: [https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html)

May be `unsigned_long`?

---

<div class="post-metadata">

**Author:** ![AKASH\_DUBEY1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akash_dubey1/32/80336_2.png) [@AKASH\_DUBEY1](https://discuss.elastic.co/u/AKASH_DUBEY1)\
**Post date:** [December 22, 2020, 3:21pm UTC](https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391/4 "2020-12-22T15:21:57Z")

</div>

`unassigned_long has the same range as java long.`

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 23, 2020, 2:45am UTC](https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391/5 "2020-12-23T02:45:24Z")

</div>

According to the documentation there's a difference for the max value.

Did you try?

Could you provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

---

<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:** [January 20, 2021, 2:45am UTC](https://discuss.elastic.co/t/how-to-store-big-int-value-in-elastic/259391/6 "2021-01-20T02:45:25Z")

</div>

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