Module org.apache.lucene.suggest
Record Class NRTSuggester.ScoringPathComparator
java.lang.Object
java.lang.Record
org.apache.lucene.search.suggest.document.NRTSuggester.ScoringPathComparator
- All Implemented Interfaces:
Comparator<Util.FSTPath<PairOutputs.Pair<Long,
BytesRef>>>
- Enclosing class:
NRTSuggester
private static record NRTSuggester.ScoringPathComparator(CompletionScorer scorer)
extends Record
implements Comparator<Util.FSTPath<PairOutputs.Pair<Long,BytesRef>>>
Compares partial completion paths using
CompletionScorer.score(float, float)
, breaks
ties comparing path inputs-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CompletionScorer
The field for thescorer
record component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Creates an instance of aScoringPathComparator
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(Util.FSTPath<PairOutputs.Pair<Long, BytesRef>> first, Util.FSTPath<PairOutputs.Pair<Long, BytesRef>> second) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.scorer()
Returns the value of thescorer
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
scorer
The field for thescorer
record component.
-
-
Constructor Details
-
ScoringPathComparator
Creates an instance of aScoringPathComparator
record class.- Parameters:
scorer
- the value for thescorer
record component
-
-
Method Details
-
compare
public int compare(Util.FSTPath<PairOutputs.Pair<Long, BytesRef>> first, Util.FSTPath<PairOutputs.Pair<Long, BytesRef>> second) - Specified by:
compare
in interfaceComparator<Util.FSTPath<PairOutputs.Pair<Long,
BytesRef>>>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
.- Specified by:
equals
in interfaceComparator<Util.FSTPath<PairOutputs.Pair<Long,
BytesRef>>> - Specified by:
equals
in classRecord
- Parameters:
o
- the object with which to compare- Returns:
true
if this object is the same as theo
argument;false
otherwise.
-
scorer
Returns the value of thescorer
record component.- Returns:
- the value of the
scorer
record component
-