Aggregation value error in Elastic Search

160 views Asked by At

I am trying to create a Date Histogram and aggregate a particular field to find the maximum value which is of long type in mapping from my ealsticsearch, but i get the result in floating point number, for example : Instead of getting 31032832 am getting 3.1032832E7

However am able to get 31032832 properly when i query my elasticsearch index through chrome plugin sense.

1

There are 1 answers

0
Sushil Ks On BEST ANSWER

I found out what was the issue! it was giving me double value after aggregation because of this:

enter image description here

while accessing i called myResult.getMax().longValue() which solved my problem.