Search code examples
elasticsearchelasticsearch-pluginsense

Aggregation value error in Elastic Search


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.


Solution

  • 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.