public protocol SearchInterface : AnyObject

Provides the protocol for the online and offline search engines.

  • Performs an asynchronous text query search for Place instances within a given TextQuery.Area. The returned places are sorted by relevance.

    Declaration

    Swift

    @discardableResult
    func searchByText(_ query: TextQuery, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandle

    Parameters

    query

    Desired free-form text query to search.

    options

    Search options.

    completion

    Callback which receives the result on the main thread.

    Return Value

    Handle that will be used to manipulate the execution of the task.

  • Performs an asynchronous address query search for Place instances. 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 one Place result, although all found places will share the same geographic coordinates. The returned places are sorted by relevance.

    Declaration

    Swift

    @discardableResult
    func searchByAddress(_ query: AddressQuery, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandle

    Parameters

    query

    Desired free-form address query text to search.

    options

    Search options.

    completion

    Callback which receives the result on the main thread.

    Return Value

    Handle that will be used to manipulate the execution of the task.

  • Performs an asynchronous category search for Place instances. A list containing at least one PlaceCategory must be provided as part of the searchByCategory(...).query.

    Declaration

    Swift

    @discardableResult
    func searchByCategory(_ query: CategoryQuery, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandle

    Parameters

    query

    Query with list of desired categories.

    options

    Search options.

    completion

    Callback which receives the result on the main thread.

    Return Value

    Handle that will be used to manipulate the execution of the task.

  • Performs an asynchronous search for Place instances based on the given geographic coordinates. This is the same search type as reverse geocoding, except that more data is returned than just the Address related to the given coordinates. Note that more than one Place can be related to the given coordinates. The returned places are sorted by relevance.

    Declaration

    Swift

    @discardableResult
    func searchByCoordinates(_ coordinates: GeoCoordinates, options: SearchOptions, completion: @escaping SearchCompletionHandler) -> TaskHandle

    Parameters

    coordinates

    The coordinates where to search.

    options

    Search options.

    completion

    Callback which receives result on the main thread.

    Return Value

    Handle that will be used to manipulate execution of the task.

  • Performs an asynchronous search for a Place based on its ID and LanguageCode.

    Declaration

    Swift

    @discardableResult
    func searchByPlaceId(_ query: PlaceIdQuery, languageCode: LanguageCode?, completion: @escaping PlaceIdSearchCompletionHandler) -> TaskHandle

    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.

    completion

    Callback which receives the result on the main thread.

    Return Value

    Handle that will be used to manipulate the execution of the task.

  • Performs an asynchronous search for a Place based on the content found in PickedPlace. If PickedPlace data is obtained from the offline map, it may happen that the newer version that is used by the online service represented by SearchEngine no longer contains the related POI. In that case, SearchError.noResultsFound error is reported. When that happens, you may try to obtain the POI from the offline map by calling OfflineSearchEngine.searchByPickedPlace. Note that not all editions include the OfflineSearchEngine.

    Declaration

    Swift

    @discardableResult
    func searchByPickedPlace(_ pickedPlace: PickedPlace, languageCode: LanguageCode?, completion: @escaping PlaceIdSearchCompletionHandler) -> TaskHandle

    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.

    completion

    Callback which receives the result on the main thread.

    Return Value

    Handle that will be used to manipulate the execution of the task.

  • Performs an asynchronous request to suggest places for text queries and returns suggestions sorted by relevance.

    Note that while OfflineSearchEngine includes as many details as are available, SearchEngine includes only the information that is relevant for autosuggest use cases. Complete details can be obtained by searching with PlaceIdQuery.

    Declaration

    Swift

    @discardableResult
    func suggestByText(_ query: TextQuery, options: SearchOptions, completion: @escaping SuggestCompletionHandler) -> TaskHandle

    Parameters

    query

    Desired text query to search.

    options

    Search options.

    completion

    Callback which receives the result on the main thread.

    Return Value

    Handle that will be used to manipulate the execution of the task.