sdk-search / com.tomtom.online.sdk.search.data.autocomplete.response / Segment

Segment

open class Segment : Serializable

Describes a recognized entity of the Autocomplete Search result.

Constructors

<init>

Segment()

Empty constructor for the Segment.

Segment(type: SegmentType!, value: String!, matches: Matches!, id: String!, matchedAlternativeName: String!)

Default constructor for the Segment.

Properties

id

var 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, e.g., the Fuzzy Search endpoint.

matchedAlternativeName

var 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

var matches: Matches!

Defines a mapping between the inputQuery and segment.

type

var type: SegmentType!

The type of a detected entity. Currently we can detect: category, brand, plaintext. More types can appear in the future.

value

var 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, e.g., the Fuzzy Search endpoint.

Functions

getId

open fun getId(): String!

Returns a provided ID 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, e.g., the Fuzzy Search endpoint.

getMatchedAlternativeName

open fun getMatchedAlternativeName(): 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". Returns a matched alternative name optionally provided for the category segment type.

getMatches

open fun getMatches(): Matches!

Returns a mapping between the inputQuery and segment.

getType

open fun getType(): SegmentType!

The type of a detected entity. Currently we can detect: category, brand, plaintext. More types can appear in the future.

getValue

open fun getValue(): 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, e.g., the Fuzzy Search endpoint.

toString

open fun toString(): String