Question about indexing large numbers

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.



If you are dealing with non-negative whole numbers, elasticsearch also supports unsigned longs that range from [0; 2^64 -1]. This is not 38 digits, but twice larger than long.

Do you plan to run range queries 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 and get a better performance.

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