SortField

constructor(field: String?, type: SortField.Type)

Creates a sort by terms in the given field with the type of term values explicitly given.

Parameters

field

Name of field to sort by. Can be null if type is SCORE or DOC.

type

Type of values in the terms.


constructor(field: String?, type: SortField.Type, reverse: Boolean)

Creates a sort, possibly in reverse, by terms in the given field with the type of term values explicitly given.

Parameters

field

Name of field to sort by. Can be null if type is SCORE or DOC.

type

Type of values in the terms.

reverse

True if natural order should be reversed.


constructor(field: String?, comparator: FieldComparatorSource)

Creates a sort with a custom comparison function.

Parameters

field

Name of field to sort by; cannot be null.

comparator

Returns a comparator for sorting hits.


constructor(field: String?, comparator: FieldComparatorSource, reverse: Boolean)

Creates a sort, possibly in reverse, with a custom comparison function.

Parameters

field

Name of field to sort by; cannot be null.

comparator

Returns a comparator for sorting hits.

reverse

True if natural order should be reversed.