sdk-search / com.tomtom.online.sdk.search.autocomplete.entity / Segment

Segment

@PublicPreview("2021.06") data class Segment : Serializable

Describes the recognized entity of the Autocomplete search.

Parameters

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

type - The type of a detected entity.

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

matches - Informs which part of the input query is represented by a segment. Input query matching may not be continuous, so the mapping is defined by an array of matched substrings.

matchedAlternativeName - Optionally provided for the category segment type. Present only if a part of the user query matched to 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".

Properties

id

val id: String

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

matchedAlternativeName

val matchedAlternativeName: String

Optionally provided for the category segment type. Present only if a part of the user query matched to 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".

matches

val matches: List<Match>

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

type

val type: SegmentType

The type of a detected entity.

value

val value: String

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