AutocompleteSegment
@objcMembers
public class AutocompleteSegment
Describes entities detected in the result.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Creates a segment that matches autocomplete request.
Declaration
Swift
required public init( type: AutocompleteMatchType, value: String, matches: AutocompleteMatches, poiCategory: PoiCategory?, matchedAlternativeName: String? )
Parameters
type
specifies type of the match (e.g. “category”, “brand”).
value
specifies the matching name.
matches
the matches for the autocomplete request.
poiCategory
a poi category for the given segment.
matchedAlternativeName
an alternative name fo the match.
-
The type of entity that has been detected
Declaration
Swift
public let type: AutocompleteMatchType
-
The value of the detected entity. It may be a category name, brand name, or a piece of unrecognized text.
Declaration
Swift
public let value: String
-
Defines the mapping between the inputQuery and the segment
Declaration
Swift
public let matches: AutocompleteMatches
-
POI Category for the given segment. Can be used to restrict the results of other search endpoints to Points Of Interest (POIs) from specific categories.
Declaration
Swift
public let poiCategory: PoiCategory?
-
Optional category segment type. Only used if a part of the user query matches the alternative name instead of a primary name. For example, for the input query “petrol station” the category segment value will be “gas station” and the matchedAlternativeName will be “petrol station”.
Declaration
Swift
public let matchedAlternativeName: String?