SortedSetSortField

class SortedSetSortField(field: String, reverse: Boolean, val selector: SortedSetSelector.Type = SortedSetSelector.Type.MIN) : SortField

SortField for SortedSetDocValues.

A SortedSetDocValues contains multiple values for a field, so sorting with this technique "selects" a value as the representative sort value for the document.

By default, the minimum value in the set is selected as the sort value, but this can be customized. Selectors other than the default do have some limitations to ensure that all selections happen in constant-time for performance.

Like sorting by string, this also supports sorting missing values as first or last, via .setMissingValue.

See also

Constructors

Link copied to clipboard
constructor(field: String, reverse: Boolean, selector: SortedSetSelector.Type = SortedSetSelector.Type.MIN)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

A SortFieldProvider for this sort

Properties

Link copied to clipboard

Returns the name of the field. Could return null if the sort is by SCORE or DOC.

Link copied to clipboard
open override val indexSorter: IndexSorter

Returns an IndexSorter used for sorting index segments by this SortField.

Link copied to clipboard
open override var missingValue: Any?

Set how missing values (the empty set) are sorted.

Link copied to clipboard

Returns whether sort optimization should be optimized with indexed data

Link copied to clipboard
Link copied to clipboard

Returns whether the sort should be reversed.

Link copied to clipboard
Link copied to clipboard
open lateinit var type: SortField.Type

Functions

Link copied to clipboard
open operator override fun equals(obj: Any?): Boolean

Returns true if o is equal to this. If a FieldComparatorSource was provided, it must properly implement equals (unless a singleton is always used).

Link copied to clipboard
Link copied to clipboard
open override fun getComparator(numHits: Int, pruning: Pruning): FieldComparator<*>

Returns the FieldComparator to use for sorting.

Link copied to clipboard

Returns the FieldComparatorSource used for custom sorting

Link copied to clipboard
open override fun hashCode(): Int

Returns the selector in use for this sort

Link copied to clipboard
open fun needsScores(): Boolean

Whether the relevance score is needed to sort documents.

Link copied to clipboard
open fun rewrite(searcher: IndexSearcher): SortField

Rewrites this SortField, returning a new SortField if a change is made. Subclasses should override this define their rewriting behavior when this SortField is of type

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String