Class LuceneTermFieldComparator<T>
java.lang.Object
org.apache.lucene.search.FieldComparator<T>
com.atlassian.confluence.internal.search.v2.lucene.LuceneTermFieldComparator<T>
- Direct Known Subclasses:
LuceneMultiTermFieldComparator
public class LuceneTermFieldComparator<T>
extends org.apache.lucene.search.FieldComparator<T>
When returned from FieldComparatorSource.newComparator, a LuceneTermFieldComparator compares hits so as to
determine their sort order when collecting results, using a custom sort comparator.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.search.FieldComparator
org.apache.lucene.search.FieldComparator.ByteComparator, org.apache.lucene.search.FieldComparator.DocComparator, org.apache.lucene.search.FieldComparator.DoubleComparator, org.apache.lucene.search.FieldComparator.FloatComparator, org.apache.lucene.search.FieldComparator.IntComparator, org.apache.lucene.search.FieldComparator.LongComparator, org.apache.lucene.search.FieldComparator.NumericComparator<T extends Number>, org.apache.lucene.search.FieldComparator.RelevanceComparator, org.apache.lucene.search.FieldComparator.ShortComparator, org.apache.lucene.search.FieldComparator.TermOrdValComparator, org.apache.lucene.search.FieldComparator.TermValComparator -
Constructor Summary
ConstructorsConstructorDescriptionLuceneTermFieldComparator(String fieldName, Function<org.apache.lucene.util.BytesRef, T> parser, Comparator<T> comparator, int numHits) -
Method Summary
Modifier and TypeMethodDescriptionintcompare(int slot1, int slot2) intcompareBottom(int doc) intcompareDocToValue(int doc, T value) intcompareValues(T x, T y) voidcopy(int slot, int doc) protected Stringprotected TgetSortValue(int doc) protected org.apache.lucene.index.BinaryDocValuesgetTerms(org.apache.lucene.index.AtomicReaderContext context) voidsetBottom(int slot) org.apache.lucene.search.FieldComparator<T> setNextReader(org.apache.lucene.index.AtomicReaderContext context) value(int slot) Methods inherited from class org.apache.lucene.search.FieldComparator
setScorer
-
Constructor Details
-
LuceneTermFieldComparator
public LuceneTermFieldComparator(String fieldName, Function<org.apache.lucene.util.BytesRef, T> parser, Comparator<T> comparator, int numHits)
-
-
Method Details
-
getFieldName
-
compareValues
- Overrides:
compareValuesin classorg.apache.lucene.search.FieldComparator<T>
-
compare
public int compare(int slot1, int slot2) - Specified by:
comparein classorg.apache.lucene.search.FieldComparator<T>
-
setBottom
public void setBottom(int slot) - Specified by:
setBottomin classorg.apache.lucene.search.FieldComparator<T>
-
compareBottom
- Specified by:
compareBottomin classorg.apache.lucene.search.FieldComparator<T>- Throws:
IOException
-
copy
- Specified by:
copyin classorg.apache.lucene.search.FieldComparator<T>- Throws:
IOException
-
setNextReader
public org.apache.lucene.search.FieldComparator<T> setNextReader(org.apache.lucene.index.AtomicReaderContext context) throws IOException - Specified by:
setNextReaderin classorg.apache.lucene.search.FieldComparator<T>- Throws:
IOException
-
getTerms
protected org.apache.lucene.index.BinaryDocValues getTerms(org.apache.lucene.index.AtomicReaderContext context) throws IOException - Throws:
IOException
-
value
- Specified by:
valuein classorg.apache.lucene.search.FieldComparator<T>
-
compareDocToValue
- Specified by:
compareDocToValuein classorg.apache.lucene.search.FieldComparator<T>- Throws:
IOException
-
getSortValue
-