WARNING: Version 6.1 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Sort Processor
editSort Processor
editSorts the elements of an array ascending or descending. Homogeneous arrays of numbers will be sorted numerically, while arrays of strings or heterogeneous arrays of strings + numbers will be sorted lexicographically. Throws an error when the field is not an array.
Table 32. Sort Options
Name | Required | Default | Description |
---|---|---|---|
|
yes |
- |
The field to be sorted |
|
no |
|
The sort order to use. Accepts |
|
no |
|
The field to assign the sorted value to, by default |
{ "sort": { "field": "field_to_sort", "order": "desc" } }