Sum aggregate of field stored in non integer data type

Hi Team,

I am working on a data set where a number is 32 bytes with max value 2 ^ 256 -1. I cant store this into Integer data type.

How can I run sum aggregation on this field? In below example _tokenAmount is that field for this instance.

Sample data

"_index": "bounty_network",
"_type": "_doc",
"_id": "0xdfca7d9cb54e5f91282ce1c07f52240e2421c9e1c97dec848ffe83b78b055b0e-136",
"_version": 8,
"_score": 0,
"_source": {
"__typename": "FulfillmentAccepted",
"_approver": "0xd8d149e288273b35c633afc0f825ef273e2f1257",
"_bountyId": "18",
"_fulfillmentId": "26",
"_tokenAmount": "250000000000000000"
"blockNumber": "8274948"
"highlight": {
"__typename": [

1 Like

I am also facing similar issue.
Trying to index token amount which is fetched from ethereum in ElasticSearch but getting below exception:

Caused by: java.lang.IllegalArgumentException: Value [2000000000000000000000] is out of range for a long
at ~[elasticsearch-x-content-7.3.1.jar:7.3.1]

Not sure how to proceed. Can someone please help?

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