byField

fun byField(field: String, type: FieldType = FieldType.AUTO, mode: Mode = Mode.DEFAULT, missing: Missing = Missing.LAST, direction: Direction = Direction.ASCENDING): SearchSort

Parameters

field

Specifies the name of a field on which to sort.

mode

Specifies the search-order for index-fields that contain multiple values (as a consequence of arrays or multi-token analyzer-output). The default order is undefined but deterministic, allowing the paging of results from from (offset) with reliable ordering. To sort using the minimum or maximum value, the value of mode should be set to either min or max.

type

Specifies the type of the search-order field value. For example, string for text fields, date for DateTime fields, or number for numeric/geo fields.

missing

Specifies the sort-procedure for documents with a missing value in a field specified for sorting. The value of missing can be first, in which case results with missing values appear before other results, or last (the default), in which case they appear after.