getStringSortField
public static org.apache.lucene.search.SortField getStringSortField(java.lang.String fieldName,
boolean reverse,
boolean nullLast,
boolean nullFirst)
Returns a 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.
- Parameters:
fieldName
- the name of the field to sort on
reverse
- true for a reverse (desc) sort
nullLast
- true if null should come last, regardless of sort order
nullFirst
- true if null should come first, regardless of sort order
- Returns:
- SortField