• public final class Suggestion
    extends NativeBase

    Suggestion is meant to provide relevant suggestions to partial queries, like "restaur", "starbu", "eiffel". Represents a relevant response to user queries. Suggestions (please check SuggestionType) are either: Place: SuggestionType.PLACE Query: SuggestionType.CHAIN or SuggestionType.CATEGORY

    With "Place" you get data for a concrete place in the world. With "Query" something to follow-up, a way to perform more focused search.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<HighlightType,​java.util.List<IndexRange>> getHighlights()
      The text slices matching the input query.
      java.lang.String getHref()
      Gets the direct link for Discover query.
      java.lang.String getId()
      Gets the suggested item id.
      Place getPlace()
      Gets the suggested place item.
      java.lang.String getTitle()
      Gets the localized title for the suggestion.
      SuggestionType getType()
      Gets the type of suggestion.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getHighlights

        @NonNull
        public java.util.Map<HighlightType,​java.util.List<IndexRange>> getHighlights()

        The text slices matching the input query.

        Returns:

        Associated container where HighlightType is a key and list of IndexRange value.

      • getTitle

        @NonNull
        public java.lang.String getTitle()

        Gets the localized title for the suggestion.

        Returns:

        The localized title for the suggestion.

      • getType

        @NonNull
        public SuggestionType getType()

        Gets the type of suggestion.

        Returns:

        Type of the suggestion.

      • getPlace

        @Nullable
        public Place getPlace()

        Gets the suggested place item.

        Returns:

        The suggested place. Note: Available only for SuggestionType.PLACE.

      • getId

        @Nullable
        public java.lang.String getId()

        Gets the suggested item id.

        Returns:

        The unique id of suggested item. It can be used to query further information. Note: For online search, suggestion of type SuggestionType.PLACE will have Suggestion.id same as Place.id. Note: For offline search, only suggestion of type SuggestionType.CHAIN, will have this property filled with identifier number of an associated chain. For example, the chain ID "8778" corresponds to the chain name "ABC Shop". For other types, SuggestionType.PLACE and SuggestionType.CATEGORY this property will be null.

      • getHref

        @Nullable
        public java.lang.String getHref()

        Gets the direct link for Discover query. Note: This is not supported in offline search.

        Returns:

        Direct URL for precise query. Note: Available only for SuggestionType.CHAIN and SuggestionType.CATEGORY.