SearchInterface (API Reference)
Interface SearchInterface
- All Known Implementing Classes:
OfflineSearchEngine,SearchEngine
Provides the interface for the online and offline search engines.
-
Method Summary
Modifier and TypeMethodDescriptionsearchByAddress(AddressQuery query, SearchOptions options, SearchCallback callback) Performs an asynchronous address query search forPlaceinstances.searchByCategory(CategoryQuery query, SearchOptions options, SearchCallback callback) Performs an asynchronous category search forPlaceinstances.searchByCoordinates(GeoCoordinates coordinates, SearchOptions options, SearchCallback callback) Performs an asynchronous search forPlaceinstances based on the given geographic coordinates.searchByPickedPlace(PickedPlace pickedPlace, LanguageCode languageCode, PlaceIdSearchCallback callback) Performs an asynchronous search for aPlacebased on the content found inPickedPlace.searchByPlaceId(PlaceIdQuery query, LanguageCode languageCode, PlaceIdSearchCallback callback) Performs an asynchronous search for aPlacebased on its ID andLanguageCode.searchByText(TextQuery query, SearchOptions options, SearchCallback callback) Performs an asynchronous text query search forPlaceinstances within a givenTextQuery.Area.suggestByText(TextQuery query, SearchOptions options, SuggestCallback callback) Performs an asynchronous request to suggest places for text queries and returns suggestions sorted by relevance.
-
Method Details
-
searchByText
@NonNull TaskHandle searchByText(@NonNull TextQuery query, @NonNull SearchOptions options, @NonNull SearchCallback callback) Performs an asynchronous text query search for
Placeinstances within a givenTextQuery.Area. The returned places are sorted by relevance.- Parameters:
query-Desired free-form text query to search.
options-Search options.
callback-Callback which receives the result on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
searchByAddress
@NonNull TaskHandle searchByAddress(@NonNull AddressQuery query, @NonNull SearchOptions options, @NonNull SearchCallback callback) Performs an asynchronous address query search for
Placeinstances. This is the same type of search as forward geocoding, except that more data is returned than just the geographic coordinates of a given address. Note that an address can belong to more than onePlaceresult, although all found places will share the same geographic coordinates. The returned places are sorted by relevance.- Parameters:
query-Desired free-form address query text to search.
options-Search options.
callback-Callback which receives the result on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
searchByCategory
@NonNull TaskHandle searchByCategory(@NonNull CategoryQuery query, @NonNull SearchOptions options, @NonNull SearchCallback callback) Performs an asynchronous category search for
Placeinstances. A list containing at least onePlaceCategorymust be provided as part of thequery.- Parameters:
query-Query with list of desired categories.
options-Search options.
callback-Callback which receives the result on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
searchByCoordinates
@NonNull TaskHandle searchByCoordinates(@NonNull GeoCoordinates coordinates, @NonNull SearchOptions options, @NonNull SearchCallback callback) Performs an asynchronous search for
Placeinstances based on the given geographic coordinates. This is the same search type as reverse geocoding, except that more data is returned than just theAddressrelated to the given coordinates. Note that more than onePlacecan be related to the given coordinates. The returned places are sorted by relevance.- Parameters:
coordinates-The coordinates where to search.
options-Search options.
callback-Callback which receives result on the main thread.
- Returns:
Handle that will be used to manipulate execution of the task.
-
searchByPlaceId
@NonNull TaskHandle searchByPlaceId(@NonNull PlaceIdQuery query, @Nullable LanguageCode languageCode, @NonNull PlaceIdSearchCallback callback) Performs an asynchronous search for a
Placebased on its ID andLanguageCode.- Parameters:
query-The id of place to search.
languageCode-The preferred language for the search results. When unset or unsupported language is chosen, results will be returned in their local language.
callback-Callback which receives the result on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
searchByPickedPlace
@NonNull TaskHandle searchByPickedPlace(@NonNull PickedPlace pickedPlace, @Nullable LanguageCode languageCode, @NonNull PlaceIdSearchCallback callback) Performs an asynchronous search for a
Placebased on the content found inPickedPlace. IfPickedPlacedata is obtained from the offline map, it may happen that the newer version that is used by the online service represented bySearchEngineno longer contains the related POI. In that case,SearchError.NO_RESULTS_FOUNDerror is reported. When that happens, you may try to obtain the POI from the offline map by callingOfflineSearchEngine.searchByPickedPlace, only available for the Navigate license.- Parameters:
pickedPlace-The content picked from map.
languageCode-The preferred language for the search result. When unset or unsupported language is chosen, result will be returned in the local language.
callback-Callback which receives the result on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-
suggestByText
@NonNull TaskHandle suggestByText(@NonNull TextQuery query, @NonNull SearchOptions options, @NonNull SuggestCallback callback) Performs an asynchronous request to suggest places for text queries and returns suggestions sorted by relevance.
Note that while
OfflineSearchEngineincludes as many details as are available,SearchEngineincludes only the information that is relevant for autosuggest use cases. Complete details can be obtained by searching withPlaceIdQuery.- Parameters:
query-Desired text query to search.
options-Search options.
callback-Callback which receives the result on the main thread.
- Returns:
Handle that will be used to manipulate the execution of the task.
-