Sorting lists in painless

In a script_field I'm trying sort and array of objects by a sub field. What is the correct way to sort these.

Eg each locations has a distance field and i'd like to order the objects in the list by distance.

List locations = params['_source']['locations'];

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