Package org.apache.lucene.search.suggest
Class Lookup.LookupResult
- java.lang.Object
-
- org.apache.lucene.search.suggest.Lookup.LookupResult
-
- All Implemented Interfaces:
Comparable<Lookup.LookupResult>
- Enclosing class:
- Lookup
public static final class Lookup.LookupResult extends Object implements Comparable<Lookup.LookupResult>
Result of a lookup.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
-
Field Summary
Fields Modifier and Type Field Description Set<BytesRef>contextsthe key's contexts (null if not present)ObjecthighlightKeyExpert: custom Object to hold the result of a highlighted suggestion.CharSequencekeythe key's textBytesRefpayloadthe key's payload (null if not present)longvaluethe key's weight
-
Constructor Summary
Constructors Constructor Description LookupResult(CharSequence key, long value)Create a new result from a key+weight pair.LookupResult(CharSequence key, long value, Set<BytesRef> contexts)Create a new result from a key+weight+contexts triple.LookupResult(CharSequence key, long value, BytesRef payload)Create a new result from a key+weight+payload triple.LookupResult(CharSequence key, long value, BytesRef payload, Set<BytesRef> contexts)Create a new result from a key+weight+payload+contexts triple.LookupResult(CharSequence key, Object highlightKey, long value, BytesRef payload)Create a new result from a key+highlightKey+weight+payload triple.LookupResult(CharSequence key, Object highlightKey, long value, BytesRef payload, Set<BytesRef> contexts)Create a new result from a key+highlightKey+weight+payload+contexts triple.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Lookup.LookupResult o)Compare alphabetically.StringtoString()
-
-
-
Field Detail
-
key
public final CharSequence key
the key's text
-
highlightKey
public final 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(CharSequence key, long value)
Create a new result from a key+weight pair.
-
LookupResult
public LookupResult(CharSequence key, long value, BytesRef payload)
Create a new result from a key+weight+payload triple.
-
LookupResult
public LookupResult(CharSequence key, Object highlightKey, long value, BytesRef payload)
Create a new result from a key+highlightKey+weight+payload triple.
-
LookupResult
public LookupResult(CharSequence key, long value, BytesRef payload, Set<BytesRef> contexts)
Create a new result from a key+weight+payload+contexts triple.
-
LookupResult
public LookupResult(CharSequence key, long value, Set<BytesRef> contexts)
Create a new result from a key+weight+contexts triple.
-
LookupResult
public LookupResult(CharSequence key, Object highlightKey, long value, BytesRef payload, Set<BytesRef> contexts)
Create a new result from a key+highlightKey+weight+payload+contexts triple.
-
-
Method Detail
-
compareTo
public int compareTo(Lookup.LookupResult o)
Compare alphabetically.- Specified by:
compareToin interfaceComparable<Lookup.LookupResult>
-
-