public class Sorting extends Object
Constructor and Description |
---|
Sorting() |
Modifier and Type | Method and Description |
---|---|
static org.apache.lucene.search.SortField |
getStringSortField(String fieldName,
boolean reverse,
boolean nullLast,
boolean nullFirst)
Returns a
SortField for a string field. |
static org.apache.lucene.search.SortField |
getTextSortField(String fieldName,
boolean reverse,
boolean nullLast,
boolean nullFirst)
Like
getStringSortField(java.lang.String, boolean, boolean, boolean) ) except safe for tokenized fields |
public static org.apache.lucene.search.SortField getStringSortField(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 orderpublic static org.apache.lucene.search.SortField getTextSortField(String fieldName, boolean reverse, boolean nullLast, boolean nullFirst)
getStringSortField(java.lang.String, boolean, boolean, boolean)
) except safe for tokenized fieldsCopyright © 2000–2015 The Apache Software Foundation. All rights reserved.