public class Sorting
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static org.apache.lucene.search.FieldComparatorSource |
nullStringLastComparatorSource |
| Constructor and Description |
|---|
Sorting() |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.lucene.search.SortField |
getStringSortField(java.lang.String fieldName,
boolean reverse,
boolean nullLast,
boolean nullFirst)
Returns a
SortField for a string field. |
static final org.apache.lucene.search.FieldComparatorSource nullStringLastComparatorSource
public static org.apache.lucene.search.SortField getStringSortField(java.lang.String fieldName,
boolean reverse,
boolean nullLast,
boolean nullFirst)
SortField for a string field.
If nullLast and nullFirst are both false, then default lucene string sorting is used where
null strings sort first in an ascending sort, and last in a descending sort.fieldName - the name of the field to sort onreverse - true for a reverse (desc) sortnullLast - true if null should come last, regardless of sort ordernullFirst - true if null should come first, regardless of sort order