Class Suggest.Suggestion.Entry<O extends Suggest.Suggestion.Entry.Option>

org.elasticsearch.search.suggest.Suggest.Suggestion.Entry<O>
All Implemented Interfaces:
<O>, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment
Direct Known Subclasses:
CompletionSuggestion.Entry, PhraseSuggestion.Entry, TermSuggestion.Entry
Enclosing class:
Suggest.Suggestion<T extends Suggest.Suggestion.Entry>

public abstract static class Suggest.Suggestion.Entry<O extends Suggest.Suggestion.Entry.Option> extends implements <O>, Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
Represents a part from the suggest text with suggested options.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Contains the suggested text with its document frequency and score.

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

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.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
    protected int
     
    protected int
     
    protected <O>
     
    protected static
     
    protected Text
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
     
     
     
    Entry​(Text text, int offset, int length)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addOption​(O option)
     
    protected void
    <O> options)
     
    protected static void
    > parser)
     
    boolean
     o)
     
    int
     
    int
     
    <O>
     
     
    int
     
    <O>
     
    protected void
    Merge any extra fields for this subtype.
    protected abstract O
     
    <T> toReduce)
     
    protected void
    <O> comparator)
     
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    void
    Write this into the StreamOutput.

    Methods inherited from class java.lang.

    , , , , , , , ,

    Methods inherited from interface java.lang.

    ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

  • Constructor Details

    • Entry

      public Entry(Text text, int offset, int length)
    • Entry

      protected Entry()
    • Entry

      public Entry(StreamInput in) throws
      Throws:
  • Method Details

    • addOption

      public void addOption(O option)
    • addOptions

      protected void addOptions(<O> options)
    • sort

      protected void sort(<O> comparator)
    • reduce

      protected <T extends Suggest.Suggestion.Entry<O>> <T> toReduce)
    • merge

      protected void merge(Suggest.Suggestion.Entry<O> other)
      Merge any extra fields for this subtype.
    • getText

      public Text getText()
      Returns:
      the text (analyzed by suggest analyzer) originating from the suggest text. Usually this is a single term.
    • getOffset

      public int getOffset()
      Returns:
      the start offset (not analyzed) for this entry in the suggest text.
    • getLength

      public int getLength()
      Returns:
      the length (not analyzed) for this entry in the suggest text.
    • iterator

      public <O> iterator()
      Specified by:
       in interface <O extends Suggest.Suggestion.Entry.Option>
    • getOptions

      public <O> getOptions()
      Returns:
      The suggested options for this particular suggest entry. If there are no suggested terms then an empty list is returned.
    • equals

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

      public int hashCode()
      Overrides:
       in class 
    • newOption

      protected abstract O newOption(StreamInput in) throws
      Throws:
    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
    • toXContent

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

      protected static void declareCommonFields(org.elasticsearch.common.xcontent.ObjectParser<? extends > parser)