Class Suggest.Suggestion.Entry.Option

java.lang.Object
org.elasticsearch.search.suggest.Suggest.Suggestion.Entry.Option
All Implemented Interfaces:
Writeable, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.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, org.elasticsearch.xcontent.ToXContentFragment
Contains the suggested text with its document frequency and score.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent

    org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.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 final org.elasticsearch.xcontent.ParseField
     
    static final org.elasticsearch.xcontent.ParseField
     
    static final org.elasticsearch.xcontent.ParseField
     
    static final org.elasticsearch.xcontent.ParseField
     

    Fields inherited from interface org.elasticsearch.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Option(Text text, float score)
     
    Option(Text text, Text highlighted, float score)
     
    Option(Text text, Text highlighted, float score, Boolean collateMatch)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
     
     
    float
     
     
    int
     
    protected void
     
    protected void
    setScore(float score)
     
    org.elasticsearch.xcontent.XContentBuilder
    toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params)
     
    void
    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.xcontent.ToXContentFragment

    isFragment
  • Field Details

    • TEXT

      public static final org.elasticsearch.xcontent.ParseField TEXT
    • HIGHLIGHTED

      public static final org.elasticsearch.xcontent.ParseField HIGHLIGHTED
    • SCORE

      public static final org.elasticsearch.xcontent.ParseField SCORE
    • COLLATE_MATCH

      public static final org.elasticsearch.xcontent.ParseField COLLATE_MATCH
  • Constructor Details

  • Method Details

    • 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 IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
      IOException
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • mergeInto

      protected void mergeInto(Suggest.Suggestion.Entry.Option otherOption)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object