Package org.apache.lucene.search.suggest
Class Lookup.LookupResult
- java.lang.Object
-
- org.apache.lucene.search.suggest.Lookup.LookupResult
-
- All Implemented Interfaces:
java.lang.Comparable<Lookup.LookupResult>
- Enclosing class:
- Lookup
public static final class Lookup.LookupResult extends java.lang.Object implements java.lang.Comparable<Lookup.LookupResult>
Result of a lookup.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.ObjecthighlightKeyExpert: custom Object to hold the result of a highlighted suggestion.java.lang.CharSequencekeythe key's textBytesRefpayloadthe key's payload (null if not present)longvaluethe key's weight
-
Constructor Summary
Constructors Constructor Description LookupResult(java.lang.CharSequence key, long value)Create a new result from a key+weight pair.LookupResult(java.lang.CharSequence key, long value, BytesRef payload)Create a new result from a key+weight+payload triple.LookupResult(java.lang.CharSequence key, java.lang.Object highlightKey, long value, BytesRef payload)Create a new result from a key+highlightKey+weight+payload triple.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Lookup.LookupResult o)Compare alphabetically.java.lang.StringtoString()
-
-
-
Field Detail
-
key
public final java.lang.CharSequence key
the key's text
-
highlightKey
public final java.lang.Object highlightKey
Expert: custom Object to hold the result of a highlighted suggestion.
-
value
public final long value
the key's weight
-
payload
public final BytesRef payload
the key's payload (null if not present)
-
-
Constructor Detail
-
LookupResult
public LookupResult(java.lang.CharSequence key, long value)Create a new result from a key+weight pair.
-
LookupResult
public LookupResult(java.lang.CharSequence key, long value, BytesRef payload)Create a new result from a key+weight+payload triple.
-
LookupResult
public LookupResult(java.lang.CharSequence key, java.lang.Object highlightKey, long value, BytesRef payload)Create a new result from a key+highlightKey+weight+payload triple.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(Lookup.LookupResult o)
Compare alphabetically.- Specified by:
compareToin interfacejava.lang.Comparable<Lookup.LookupResult>
-
-