AutocompleteSegment

data class AutocompleteSegment(    val type: String,     val value: String,     val matches: Matches,     val id: String? = null,     val matchedAlternativeName: String? = null)

Describes an entity found within the autocomplete search term. An entity is a distinct part of the search term that can be used to generate a query.

See also

https://developer.tomtom.com/search-api/search-api-documentation-search/fuzzy-search

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

Parameters

type

The type of entity detected.

value

The value of the entity. It may be a category name, brand name, or a piece of unrecognized text. If it's a brand segment, the content of this field can be used to restrict results of other search endpoints to Points Of Interest (POI) for specific brands. See the brandSet parameter in the Fuzzy Search service https://developer.tomtom.com/search-api/search-api-documentation-search/fuzzy-search.

matches

Reports which part of the input query contains the matched segment. Input query matching may not be continuous, so the mapping is defined by an array of matched substrings.

id

Category segment type. Can be used to restrict the results of other search endpoints to Points Of Interest (POI) from specific categories. See the categorySet parameter in the Fuzzy Search service https://developer.tomtom.com/search-api/search-api-documentation-search/fuzzy-search.

matchedAlternativeName

(Optional) category segment type. Present only if a part of the user query matches an alternative name instead of a primary name. For example, for the input query "petrol station" the category segment value is "gas station" and the matchedAlternativeName is "petrol station".

Constructors

Link copied to clipboard
fun AutocompleteSegment(    type: String,     value: String,     matches: Matches,     id: String? = null,     matchedAlternativeName: String? = null)

Properties

Link copied to clipboard
val id: String? = null
Link copied to clipboard
val matchedAlternativeName: String? = null
Link copied to clipboard
val matches: Matches
Link copied to clipboard
val type: String
Link copied to clipboard
val value: String