Class Suggest.Suggestion<T extends Suggest.Suggestion.Entry>

    • Constructor Detail

      • Suggestion

        protected Suggestion()
      • Suggestion

        public Suggestion​(java.lang.String name,
                          int size)
    • Method Detail

      • addTerm

        public void addTerm​(T entry)
      • getWriteableType

        public int getWriteableType()
        Returns a integer representing the type of the suggestion. This is used for internal serialization over the network.
      • getType

        protected java.lang.String getType()
        Returns a string representing the type of the suggestion. This type is added to the suggestion name in the XContent response, so that it can later be used by REST clients to determine the internal type of the suggestion.
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T extends Suggest.Suggestion.Entry>
      • getEntries

        public java.util.List<T> getEntries()
        Returns:
        The entries for this suggestion.
      • getName

        public java.lang.String getName()
        Returns:
        The name of the suggestion as is defined in the request.
      • getSize

        public int getSize()
        Returns:
        The number of requested suggestion option size
      • trim

        public void trim()
        Trims the number of options per suggest text term to the requested size. For internal usage.
      • newEntry

        protected T newEntry()
      • innerReadFrom

        protected void innerReadFrom​(StreamInput in)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • innerWriteTo

        public void innerWriteTo​(StreamOutput out)
                          throws java.io.IOException
        Throws:
        java.io.IOException