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_termswill 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 messagegoogle.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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class OnewaySynonymsAction (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.Rule.OnewaySynonymsAction)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.Rule.OnewaySynonymsAction)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.Rule.OnewaySynonymsAction)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.Rule.OnewaySynonymsAction)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.Rule.OnewaySynonymsAction)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.Rule.OnewaySynonymsAction)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.Rule.OnewaySynonymsAction)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.Rule.OnewaySynonymsAction)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.Rule.OnewaySynonymsAction)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.Rule.OnewaySynonymsAction)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.Rule.OnewaySynonymsAction)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.Rule.OnewaySynonymsAction)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.Rule.OnewaySynonymsAction) \nReference documentation and code samples for the Google Cloud Retail V2 Client class OnewaySynonymsAction.\n\nMaps a set of terms to a set of synonyms.\n\nSet of synonyms will be treated as synonyms of each query term only.\n`query_terms` will not be treated as synonyms of each other.\nExample: \"sneakers\" will use a synonym of \"shoes\".\n\"shoes\" will not use a synonym of \"sneakers\".\n\nGenerated from protobuf message `google.cloud.retail.v2.Rule.OnewaySynonymsAction`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2 \\\\ Rule\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getQueryTerms\n\nTerms from the search query.\n\nWill treat synonyms as their synonyms.\nNot themselves synonyms of the synonyms.\nCan specify up to 100 terms.\n\n### setQueryTerms\n\nTerms from the search query.\n\nWill treat synonyms as their synonyms.\nNot themselves synonyms of the synonyms.\nCan specify up to 100 terms.\n\n### getSynonyms\n\nDefines a set of synonyms.\n\nCannot contain duplicates.\nCan specify up to 100 synonyms.\n\n### setSynonyms\n\nDefines a set of synonyms.\n\nCannot contain duplicates.\nCan specify up to 100 synonyms.\n\n### getOnewayTerms\n\nWill be \\[deprecated = true\\] post migration;\n\n### setOnewayTerms\n\nWill be \\[deprecated = true\\] post migration;"]]