Search
AutocompleteGeoBias
represents geographical bias used by the autocomplete engine to improve search results.
AutocompleteGeoBias
is part of the definition for AutocompleteSummary
which is returned from the Search.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
Defines the parameters of the Autocomplete Search.
Use AutocompleteOptions
to make an Autocomplete Search request.
To learn more about Autocomplete refer to the autocomplete(options:completion:)
description.
You can also provide optional parameters to perform a more accurate search, following similar recommendation
as for search(options:completion:)
.
An example of autocomplete searching for a restaurant in Amsterdam:
let amsterdam = CLLocationCoordinate2D(latitude: 52.369979,
longitude: 4.891820)
let options = AutocompleteOptions(
query: "Rest",
position: amsterdam,
radius: Measurement(value: 3, unit: .kilometers),
countries: ["NL"],
resultTypes: [.brand, .category],
sessionID: UUID().uuidString
)
See more
Declaration
Swift
public struct AutocompleteOptions
Represents the response of the Autocomplete Search API, containing a summary and a list of autocomplete results.
autocomplete(options:completion:)
uses AutocompleteResponse
to encapsulate the results for an autocomplete request.
An example usage of AutocompleteResponse
:
let 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
See more
Declaration
Swift
public class AutocompleteResponse
The result returned by the autocomplete search.
An AutocompleteResult
object includes an array of segments that correspond to recognized entities.
These entities can be brand
, poiCategory
, or plainText
.
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 Search.autocomplete(options:completion:)
method,
accessible through the AutocompleteResponse.results
property.
Declaration
Swift
public class AutocompleteResult
The type of autocomplete result.
See moreDeclaration
Swift
public enum AutocompleteResultType
AutocompleteSegment
represents an entity found within the autocomplete search term.
An entity can be a brand, a point of interest (POI) category, or plain text. Every case has a corresponding associated object.
This enum is used in AutocompleteResult
to describe the matched entities returned from the autocomplete search.
An example of handling segments:
let options = AutocompleteOptions(
query: "mar",
position: .AMSTERDAM,
radius: Measurement(value: 100, unit: .kilometers),
countries: ["NL"]
)
search.autocomplete(options: options) { result in
if case let .success(response) = result {
response.results.forEach { result in
result.segments.forEach { segment in
switch segment {
case .brand(let brand):
print("Brand: \(brand.brand.name)")
case .poiCategory(let category):
print("Category: \(category.poiCategory.name)")
case .plainText(let text):
print("Text: \(text.plainText)")
@unknown default:
print("unknown")
}
}
}
}
}
// Prints:
// Category: Market
// Brand: Marqt
// Category: Marina
// Brand: Marriott
See more
Declaration
Swift
public enum AutocompleteSegment
Represents a recognized autocomplete result defined by a Brand
(e.g., “BMW” car brand).
Use provided Brand
in the SearchOptions.brands
to continue searching for places with the given brand.
AutocompleteSegmentBrand
is part of the AutocompleteSegment
definition to describe brand-related information in the autocomplete search results.
For example the query “BM” can return an autocomplete search result with the brand segment and the query “BMW”.
See moreDeclaration
Swift
public struct AutocompleteSegmentBrand
Represents the autocomplete result value that doesn’t match any brand or POI Category.
The plainText
can be used as a query string in the SearchOptions
to continue the search.
It is used in AutocompleteSegment
to provide plain text-related information in the autocomplete search results.
For example the query “Chess” can return an autocomplete search result with the plain text segment and the query “Chess”.
Declaration
Swift
public struct AutocompleteSegmentPlainText
AutocompleteSegmentPOICategory
represents a point of interest (POI) category segment in the autocomplete search results.
A POI category segment contains a POICategory
, which can be used as a filter in the search
method to refine search results based on the POI category information.
It also includes an optional matchedAlternativeName
to provide an alternative name for the matched POI category, if available.
This structure is used in AutocompleteSegment
to describe POI category-related information in the autocomplete search results.
Declaration
Swift
public struct AutocompleteSegmentPOICategory
AutocompleteSummary
provides information about an autocomplete request that was performed.
This class is part of the AutocompleteResponse
definition.
It contains the query phrase and geo-bias information.
Declaration
Swift
public class AutocompleteSummary
Circle geometry for searchArea.
See moreDeclaration
Swift
public struct CircleGeometry : Hashable, Equatable
A single custom POI that can be injected into the search engine.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public final class CustomPOI
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 CustomPOIProvider
Describes the details about the detour from the route to the point of interest along the route.
See moreDeclaration
Swift
public struct Detour
A container for the identifier of charging availability.
See moreDeclaration
Swift
public struct EVChargingAvailabilityID
Defines the parameters of an Electric Vehicle (EV) search.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct EVSearchOptions
A response structure that contains EV search results.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct EVSearchResponse
A search result produced by EV search.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct EVSearchResult
Feedback event describing user interactions with the search results. The client application can report these events back to the search service to be used for analyzing and improving the search service.
See moreDeclaration
Swift
public struct FeedbackEvent
Feedback event type that describes the user actions performed on a specific search result.
See moreDeclaration
Swift
public enum FeedbackEventType
Identifies the search result for which a [feedback event][FeedbackEvent] is posted.
See moreDeclaration
Swift
public protocol FeedbackResultID
Factory for creating different kinds of instances of FeedbackResultID
.
Declaration
Swift
public enum FeedbackResultIDFactory
A container for the fuel price identifier
See moreDeclaration
Swift
public struct FuelPriceID
Specifies the parameters of the geometries to query.
See moreDeclaration
Swift
public struct GeometryDataOptions
GeometryDataResponse
See moreDeclaration
Swift
public struct GeometryDataResponse
A container for parking detail identifier.
See moreDeclaration
Swift
public struct ParkingDetailID
Structure containing POI category details.
See moreDeclaration
Swift
public struct POICategory
Specifies the language and scope of POI categories.
See moreDeclaration
Swift
public struct POICategoryOptions
Structure containing POI category response.
See moreDeclaration
Swift
public struct POICategoryResponse
Defines essential parameters to fetch POI details data.
See moreDeclaration
Swift
public struct POIDetailsOptions
The result returned by Search.requestPOIDetails(options:completion:)
.
Declaration
Swift
public struct POIDetailsResponse
Polygon geometry for searchArea.
See moreDeclaration
Swift
public struct PolygonGeometry : Equatable, Hashable
Rectangle geometry for searchArea.
See moreDeclaration
Swift
public struct RectangleGeometry : Hashable
Defines common interface to provide search functionality.
See moreDeclaration
Swift
public protocol Search
Specifies fuzzy search options.
See moreDeclaration
Swift
public struct SearchOptions
Summary information about the search that was performed.
Declaration
Swift
public typealias SearchRequestSummary = SearchResponse.Summary
A response structure that contains search results for the requested search query.
See moreDeclaration
Swift
public struct SearchResponse
SearchResult Object containing grouped information about places or points of interest.
See moreDeclaration
Swift
public struct SearchResult
A structure enclosing related data IDs.
See moreDeclaration
Swift
public struct SearchResultID
Declaration
Swift
extension SearchResultType: CustomStringConvertible
The type of search result.
Declaration
Swift
public typealias SearchResultType = SearchResult.Type
Specifies the type of result sorting.
See moreDeclaration
Swift
public enum SortOrder