Module org.elasticsearch.server
Package org.elasticsearch.search.suggest
Class Suggest.Suggestion.Entry.Option
java.lang.Object
org.elasticsearch.search.suggest.Suggest.Suggestion.Entry.Option
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
- Direct Known Subclasses:
CompletionSuggestion.Entry.Option,PhraseSuggestion.Entry.Option,TermSuggestion.Entry.Option
- Enclosing class:
Suggest.Suggestion.Entry<O extends Suggest.Suggestion.Entry.Option>
public abstract static class Suggest.Suggestion.Entry.Option
extends Object
implements Writeable, ToXContentFragment
Contains the suggested text with its document frequency and score.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldstatic final ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanfloatgetScore()getText()inthashCode()protected voidmergeInto(Suggest.Suggestion.Entry.Option otherOption) toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
TEXT
-
HIGHLIGHTED
-
SCORE
-
COLLATE_MATCH
-
-
Constructor Details
-
Option
-
Option
-
Option
-
Option
- Throws:
IOException
-
-
Method Details
-
getText
- Returns:
- The actual suggested text.
-
getHighlighted
- Returns:
- Copy of suggested text with changes from user supplied text highlighted.
-
getScore
public float getScore()- Returns:
- The score based on the edit distance difference between the suggested term and the term in the suggest text.
-
collateMatch
public boolean collateMatch()- Returns:
- true if collation has found a match for the entry.
if collate was not set, the value defaults to
true
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
mergeInto
-
equals
-
hashCode
public int hashCode()
-