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
Modifier and TypeFieldDescriptionthe key's contexts (null if not present)final Object
Expert: custom Object to hold the result of a highlighted suggestion.final CharSequence
the key's textfinal BytesRef
the key's payload (null if not present)final long
the key's weight -
Constructor Summary
ConstructorDescriptionLookupResult
(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
-
Field Details
-
key
the key's text -
highlightKey
Expert: custom Object to hold the result of a highlighted suggestion. -
value
public final long valuethe key's weight -
payload
the key's payload (null if not present) -
contexts
the key's contexts (null if not present)
-
-
Constructor Details
-
LookupResult
Create a new result from a key+weight pair. -
LookupResult
Create a new result from a key+weight+payload triple. -
LookupResult
Create a new result from a key+highlightKey+weight+payload triple. -
LookupResult
Create a new result from a key+weight+payload+contexts triple. -
LookupResult
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 Details
-
toString
-
compareTo
Compare alphabetically.- Specified by:
compareTo
in interfaceComparable<Lookup.LookupResult>
-