# Question about indexing large numbers

**URL:** <https://discuss.elastic.co/t/question-about-indexing-large-numbers/276758>\
**Category:** Elasticsearch\
**Created:** [June 23, 2021, 9:19am UTC](https://discuss.elastic.co/t/question-about-indexing-large-numbers/276758 "2021-06-23T09:19:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jurgen\_Debedts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jurgen_debedts/32/49335_2.png) [@Jurgen\_Debedts](https://discuss.elastic.co/u/Jurgen_Debedts)\
**Post date:** [June 23, 2021, 9:19am UTC](https://discuss.elastic.co/t/question-about-indexing-large-numbers/276758/1 "2021-06-23T09:19:35Z")

</div>

This is somewhat a mix of conceptual and a technical question.

I am working on a search integration between an ECM platform and ES. Everything is working fine except for 1 thing.

In the ECM platform metadata field also come in different types. One of them is Integer. However the integer field in the underlying Oracle DB is defined as NUMBER(38,0). Basically this means the values can be far greater than the typical "Integer" as we knowit in ES, it can even be bigger than long or double.

So my question is, what is the advised way to set up a metadata field that will only contain numeric data, should behave as numeric search with stuff like range search, but be able to store a number of maximum 38 digits. I know this may seem extremely big, but consider that people use this to store data like invoicenumbers etc, often these are large conposite numbers that can indeed be quite long.

Thanks,

Jurgen

---

<div class="post-metadata">

**Author:** ![mayya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mayya/32/83147_2.png) [@mayya](https://discuss.elastic.co/u/mayya)\
**Post date:** [June 24, 2021, 10:37pm UTC](https://discuss.elastic.co/t/question-about-indexing-large-numbers/276758/2 "2021-06-24T22:37:08Z")

</div>

If you are dealing with non-negative whole numbers, elasticsearch also supports [unsigned longs](https://www.elastic.co/guide/en/elasticsearch/reference/current/unsigned-long.html) that range from [0; 2^64 -1]. This is not 38 digits, but twice larger than long.

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [June 25, 2021, 1:29am UTC](https://discuss.elastic.co/t/question-about-indexing-large-numbers/276758/3 "2021-06-25T01:29:29Z")

</div>

Do you plan to run [range queries](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html) in this field? If not you could map the field as a keyword.

One of the tips from the documentation is that not all numeric data needs to be mapped as numeric, depending on the type of data and its use, you can map it as [keyword](https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html#keyword-field-type) and get a better performance.

---

<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 23, 2021, 1:29am UTC](https://discuss.elastic.co/t/question-about-indexing-large-numbers/276758/4 "2021-07-23T01:29:46Z")

</div>

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