Need to get Elastic Search current highest id

Hi All,

I am new to elastic search. I am working on river jdbc mysql concepts I
have a scenario like I need to get highest value for field "id" that is
inserted in to elastic search.please suggest me how to build this query to
get highest value for id inserted.

Thanks & Regards,

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit


I got the solution to get max id .

GET /index/type/_search
"aggs" : {
"max_id" : { "max" : { "field" : "id" } }


1 Like