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 java.lang.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.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static ParseFieldCOLLATE_MATCHstatic ParseFieldHIGHLIGHTEDstatic ParseFieldSCOREstatic ParseFieldTEXT-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
Modifier and Type Method Description booleancollateMatch()booleanequals(java.lang.Object o)TextgetHighlighted()floatgetScore()TextgetText()inthashCode()protected voidmergeInto(Suggest.Suggestion.Entry.Option otherOption)protected voidsetScore(float score)XContentBuildertoXContent(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, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
TEXT
public static final ParseField TEXT
-
HIGHLIGHTED
public static final ParseField HIGHLIGHTED
-
SCORE
public static final ParseField SCORE
-
COLLATE_MATCH
public static final ParseField COLLATE_MATCH
-
-
Constructor Detail
-
Option
public Option(Text text, float score)
-
Option
public Option(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getText
public Text getText()
- Returns:
- The actual suggested text.
-
getHighlighted
public 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
-
setScore
protected void setScore(float score)
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
mergeInto
protected void mergeInto(Suggest.Suggestion.Entry.Option otherOption)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-