Google Cloud Retail V2 Client - Class OnewaySynonymsAction (1.1.1)

Reference documentation and code samples for the Google Cloud Retail V2 Client class OnewaySynonymsAction.

Maps a set of terms to a set of synonyms.

Set of synonyms will be treated as synonyms of each query term only. query_terms will not be treated as synonyms of each other. Example: "sneakers" will use a synonym of "shoes". "shoes" will not use a synonym of "sneakers".

Generated from protobuf message google.cloud.retail.v2.Rule.OnewaySynonymsAction

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ query_terms array

Terms from the search query. Will treat synonyms as their synonyms. Not themselves synonyms of the synonyms. Can specify up to 100 terms.

↳ synonyms array

Defines a set of synonyms. Cannot contain duplicates. Can specify up to 100 synonyms.

↳ oneway_terms array

Will be [deprecated = true] post migration;

getQueryTerms

Terms from the search query.

Will treat synonyms as their synonyms. Not themselves synonyms of the synonyms. Can specify up to 100 terms.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setQueryTerms

Terms from the search query.

Will treat synonyms as their synonyms. Not themselves synonyms of the synonyms. Can specify up to 100 terms.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getSynonyms

Defines a set of synonyms.

Cannot contain duplicates. Can specify up to 100 synonyms.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setSynonyms

Defines a set of synonyms.

Cannot contain duplicates. Can specify up to 100 synonyms.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getOnewayTerms

Will be [deprecated = true] post migration;

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setOnewayTerms

Will be [deprecated = true] post migration;

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this