Package org.elasticsearch.search.suggest
Class Suggest.Suggestion.Entry.Option
- java.lang.Object
-
- org.elasticsearch.search.suggest.Suggest.Suggestion.Entry.Option
-
- All Implemented Interfaces:
Streamable
,ToXContent
,ToXContentObject
- Direct Known Subclasses:
CompletionSuggestion.Entry.Option
,TermSuggestion.Entry.Option
- Enclosing class:
- Suggest.Suggestion.Entry<O extends Suggest.Suggestion.Entry.Option>
public static class Suggest.Suggestion.Entry.Option extends java.lang.Object implements Streamable, ToXContentObject
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
-
-
Field Summary
Fields Modifier and Type Field Description static ParseField
COLLATE_MATCH
static ParseField
HIGHLIGHTED
static ParseField
SCORE
static ParseField
TEXT
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
Modifier and Type Method Description boolean
collateMatch()
boolean
equals(java.lang.Object o)
static Suggest.Suggestion.Entry.Option
fromXContent(XContentParser parser)
Text
getHighlighted()
float
getScore()
Text
getText()
int
hashCode()
protected XContentBuilder
innerToXContent(XContentBuilder builder, ToXContent.Params params)
protected void
mergeInto(Suggest.Suggestion.Entry.Option otherOption)
void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.protected void
setScore(float score)
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this object's fields to a 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.ToXContentObject
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
-
-
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)
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Throws:
java.io.IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
innerToXContent
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Throws:
java.io.IOException
-
fromXContent
public static Suggest.Suggestion.Entry.Option fromXContent(XContentParser parser)
-
mergeInto
protected void mergeInto(Suggest.Suggestion.Entry.Option otherOption)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-