SearchQuery

public struct SearchQuery

Specifies fuzzy search conditions

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Declaration

    Swift

    public init(
        _ query: String = "",
        geoBias: CLLocationCoordinate2D? = nil,
        limit: Int? = nil,
        offset: Int? = nil,
        searchAreas: Geometry? = nil,
        locale: Locale = Locale.current,
        categories: Set<PoiCategoryId> = [],
        openingHours: OpeningHoursMode? = nil,
        fuzzyLevel: Int = 2,
        countries: Set<String> = [],
        brands: Set<Brand> = [],
        minPower: Measurement<UnitPower>? = nil,
        maxPower: Measurement<UnitPower>? = nil,
        fuelTypes: Set<FuelType> = [],
        resultTypeSet: [SearchResultType] = [],
        connectors: Set<ConnectorType> = [],
        geoPoliticalView: GeoPoliticalView? = nil
    )

    Parameters

    query

    The search query.

    geoBias

    The position where results should be biased.

    limit

    The maximum number of search results that will be returned.

    offset

    The starting offset of the returned results within the full result set.

    searchAreas

    The geographic filter for search, all search results returned are confined in the specified geography.

    locale

    The language in which search results should be returned. If not specified, language is set to the default official language of the location of the result.

    categories

    Restricts the Points Of Interest in the response to those whose category ID is listed.

    openingHours

    Scope of the opening hours to be provided.

    fuzzyLevel

    Fuzziness level. Ranges from 1 to 4 and defaults to 2.

    countries

    A set of ISO 3166-1 alpha3 country codes. (e.g., FRA, ESP, USA). This will limit the search to the specified countries.

    brands

    A set of brands used to restrict the result to POIs associated with those brands.

    minPower

    The minimal power that a charging station can provide.

    maxPower

    The maximal power that a charging station can provide.

    fuelTypes

    A set of fuel types that a gas station can provide.

    resultTypeSet

    A set of SearchResultType to filter results.

Public

  • The search query.

    Declaration

    Swift

    public var query: String
  • The position where results should be biased.

    Declaration

    Swift

    public var geoBias: CLLocationCoordinate2D?
  • The maximum number of search results that will be returned.

    Declaration

    Swift

    public var limit: Int?
  • The starting offset of the returned results within the full result set.

    Declaration

    Swift

    public var offset: Int?
  • The geographic filter for search, all search results returned are confined in the specified geography. СircleGeometry and RectangleGeomety support geoBias. СircleGeometry center is also used as geoBias. PolygonGeometry ignores geoBias.

    Declaration

    Swift

    public var searchAreas: Geometry?
  • The language in which search results should be returned. If not specified, language is set to the default official language of the location of the result.

    Declaration

    Swift

    public var locale: Locale?
  • Restricts the Points Of Interest in the response to those whose category ID is listed.

    Declaration

    Swift

    public var categories: Set<PoiCategoryId>
  • Scope of the opening hours to be provided.

    Declaration

    Swift

    public var openingHours: OpeningHoursMode?
  • Fuzziness level. Ranges from 1 to 4 and defaults to 2.

    Declaration

    Swift

    public var fuzzyLevel: Int
  • A set of ISO 3166-1 alpha3 country codes. (e.g., FRA, ESP, USA). This will limit the search to the specified countries.

    Declaration

    Swift

    public var countries: Set<String>
  • A set of brands used to restrict the result to POIs associated with those brands.

    Declaration

    Swift

    public var brands: Set<Brand>
  • The minimal power that a charging station can provide.

    Declaration

    Swift

    public var minPower: Measurement<UnitPower>?
  • The maximal power that a charging station can provide.

    Declaration

    Swift

    public var maxPower: Measurement<UnitPower>?
  • A set of fuel types that a gas station can provide.

    Declaration

    Swift

    public var fuelTypes: Set<FuelType>
  • A list of SearchResultType to filter results.

    Declaration

    Swift

    public var resultTypeSet: [SearchResultType]
  • A list of connector types that a charging station supports. See https://developer.tomtom.com/search-api/search-api-documentation/supported-connector-types for more details.

    Declaration

    Swift

    public var connectors: Set<ConnectorType>
  • Defines what kind of geopolitical view should be used.

    Declaration

    Swift

    public var geoPoliticalView: GeoPoliticalView?