Google Cloud Retail V2 Client - Class OnewaySynonymsAction (2.1.2)

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

Namespace

Google \ Cloud \ Retail \ V2 \ Rule

Methods

__construct

Constructor.

Parameters
Name Description
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
Type Description
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
Name Description
var string[]
Returns
Type Description
$this

getSynonyms

Defines a set of synonyms.

Cannot contain duplicates. Can specify up to 100 synonyms.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setSynonyms

Defines a set of synonyms.

Cannot contain duplicates. Can specify up to 100 synonyms.

Parameter
Name Description
var string[]
Returns
Type Description
$this

getOnewayTerms

Will be [deprecated = true] post migration;

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setOnewayTerms

Will be [deprecated = true] post migration;

Parameter
Name Description
var string[]
Returns
Type Description
$this