Classes
The following classes are available globally.
-
A single record from a custom data source.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public class CustomRecord
-
A single custom POI record.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public final class CustomPOIRecord : CustomRecord
-
Allows injecting custom POI data into the search engine.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
final public class CustomPOISearchDataProvider : CustomSearchDataProvider
-
Represents the response of the Autocomplete Search API, containing a summary and a list of autocomplete results.
autocomplete(options:completion:)
usesAutocompleteResponse
to encapsulate the results for an autocomplete request.An example usage of
AutocompleteResponse
:
See morelet options = AutocompleteOptions( query: "mar", position: .AMSTERDAM, radius: Measurement(value: 100, unit: .kilometers) ) search.autocomplete(options: options) { result in switch result { case let .success(response): response.results.forEach { result in result.segments.forEach { segment in switch segment { case .brand(let brand): print("\(brand.brand.name) - brand") case .poiCategory(let category): print("\(category.poiCategory.name) - category") case .plainText(let text): print("\(text.plainText) - plain text") @unknown default: print("unknown") } } } case let .failure(error): print("Handle error: \(error)" ) } } // Prints: // Market - category // Marqt - brand // Marina - category // Marriott - brand
Declaration
Swift
public class AutocompleteResponse
-
AutocompleteSummary
provides information about an autocomplete request that was performed.This class is part of the
See moreAutocompleteResponse
definition. It contains the query phrase and geo-bias information.Declaration
Swift
public class AutocompleteSummary
-
AutocompleteGeoBias
represents geographical bias used by the autocomplete engine to improve search results.AutocompleteGeoBias
is part of the definition forAutocompleteSummary
which is returned from theSearch.autocomplete(options:completion:)
method.Fox example, for the geobias Amsterdam query “Fie” can return the autocomplete result “Fietsenwinkel.nl”, for the geobias Berlin query “Fie” can return the autocomplete result “Fielmann”.
See moreDeclaration
Swift
public class AutocompleteGeoBias
-
The result returned by the autocomplete search.
An
AutocompleteResult
object includes an array of segments that correspond to recognized entities. These entities can bebrand
,poiCategory
, orplainText
.When the query contains multiple recognized entities, a single autocomplete result may contain multiple segments. For instance, if a user enters the query “Chess Bis,” the autocomplete search result could include 2 segments: a plain text segment containing “Chess” and a category segment with “Bistro.”
Instances of this class are utilized as components of the
See moreSearch.autocomplete(options:completion:)
method, accessible through theAutocompleteResponse.results
property.Declaration
Swift
public class AutocompleteResult
-
Represents how the user’s input query matches the provided autocomplete result.
This class provides information about the input query that triggered the autocomplete search. Such information includes the starting
offset
andlength
of the matched substring in the original text.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public class AutocompleteInputQuery