Class Suggestion
Class Suggestion
- java.lang.Object
-
- com.here.NativeBase
-
- com.here.sdk.search.Suggestion
-
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.PLACEQuery:SuggestionType.CHAINorSuggestionType.CATEGORYWith "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.StringgetHref()Gets the direct link for Discover query.java.lang.StringgetId()Gets the suggested item id.PlacegetPlace()Gets the suggested place item.java.lang.StringgetTitle()Gets the localized title for the suggestion.SuggestionTypegetType()Gets the type of suggestion.
-
-
-
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
HighlightTypeis a key and list ofIndexRangevalue.
-
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.
Available only for
SuggestionType.PLACE.- Returns:
The suggested place.
-
getId
@Nullable public java.lang.String getId()
Gets the suggested item id.
For online search, suggestion of type
SuggestionType.PLACEwill have Suggestion.id same as Place.id. For offline search, only suggestion of typeSuggestionType.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.PLACEandSuggestionType.CATEGORYthis property will be null.- Returns:
The unique id of suggested item. It can be used to query further information.
-
getHref
@Nullable public java.lang.String getHref()
Gets the direct link for Discover query.
Available only for
SuggestionType.CHAINandSuggestionType.CATEGORY. This is not supported in offline search.- Returns:
Direct URL for precise query.
-
-