How add sorting to spring data elasticsearch
You can use SortBuilders
for this.
searchQuery.withSort(SortBuilders.fieldSort("fieldName").order(SortOrder.DESC))
This will sort your result on the basis of fieldName
passed.
Hope this helps