Package org.dlese.dpc.index
Class LuceneFieldComparator
java.lang.Object
org.dlese.dpc.index.LuceneFieldComparator
- All Implemented Interfaces:
Comparator
Deprecated.
Compares two
ResultDocs for sorting by a given Lucene field. Fields that are
encoded as a Dates will be sorted by Date, all others are sorted lexically. The lucene fields must be
stored as text or keyword. The name of the field to be sorted must be passed into the constructor of this
LuceneFieldComparator.- Author:
- John Weatherley
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.Used to sort in ascending order.static final intDeprecated.Used to sort in descending order. -
Constructor Summary
ConstructorsConstructorDescriptionLuceneFieldComparator(String fieldName, int sortOrder) Deprecated.Sorting should now be done by supplying aSortobject at search time. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
ASCENDING
public static final int ASCENDINGDeprecated.Used to sort in ascending order.- See Also:
-
DESCENDING
public static final int DESCENDINGDeprecated.Used to sort in descending order.- See Also:
-
-
Constructor Details
-
LuceneFieldComparator
Deprecated.Sorting should now be done by supplying aSortobject at search time. Sorting on returned ResultDocs is less efficient and may cause OutOfMemory errors on large result sets.Constructor for this LuceneFieldComparator object.- Parameters:
fieldName- Field to sort bysortOrder- ASCENDING or DESCENDING
-
-
Method Details
-
compare
Deprecated.Compares twoResultDocs for sorting by a Lucene field, indicated at construction time.Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
- Specified by:
comparein interfaceComparator- Parameters:
o1- The first Object.o2- The second Object.- Returns:
- An int indicating sort order.
-
Sortobject at search time. Sorting on returned ResultDocs is less efficient and may cause OutOfMemory errors on large result sets.