Google Cloud Retail V2 Client - Class TwowaySynonymsAction (1.2.1)

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

Creates a set of terms that will be treated as synonyms of each other.

Example: synonyms of "sneakers" and "shoes":

  • "sneakers" will use a synonym of "shoes".
  • "shoes" will use a synonym of "sneakers".

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

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ synonyms array

Defines a set of synonyms. Can specify up to 100 synonyms. Must specify at least 2 synonyms.

getSynonyms

Defines a set of synonyms.

Can specify up to 100 synonyms. Must specify at least 2 synonyms.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setSynonyms

Defines a set of synonyms.

Can specify up to 100 synonyms. Must specify at least 2 synonyms.

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this