newFeatureSort

fun newFeatureSort(field: String, featureName: String): SortField

Creates a SortField for sorting by the value of a feature.

This sort orders documents by descending value of a feature. The value returned in [ ] for the hits contains a Float instance with the feature value.

If a document is missing the field, then it is treated as having a value of 0.0f * .

Return

SortField ordering documents by the value of the feature

Parameters

field

field name. Must not be null.

featureName

feature name. Must not be null.

Throws

if field or featureName is null.