Class: Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaRuleOnewaySynonymsAction

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/retail_v2alpha/classes.rb,
lib/google/apis/retail_v2alpha/representations.rb,
lib/google/apis/retail_v2alpha/representations.rb

Overview

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".

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2alphaRuleOnewaySynonymsAction

Returns a new instance of GoogleCloudRetailV2alphaRuleOnewaySynonymsAction.



6050
6051
6052
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 6050

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#oneway_termsArray<String>

Will be [deprecated = true] post migration; Corresponds to the JSON property onewayTerms

Returns:

  • (Array<String>)


6036
6037
6038
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 6036

def oneway_terms
  @oneway_terms
end

#query_termsArray<String>

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

Returns:

  • (Array<String>)


6042
6043
6044
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 6042

def query_terms
  @query_terms
end

#synonymsArray<String>

Defines a set of synonyms. Cannot contain duplicates. Can specify up to 100 synonyms. Corresponds to the JSON property synonyms

Returns:

  • (Array<String>)


6048
6049
6050
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 6048

def synonyms
  @synonyms
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



6055
6056
6057
6058
6059
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 6055

def update!(**args)
  @oneway_terms = args[:oneway_terms] if args.key?(:oneway_terms)
  @query_terms = args[:query_terms] if args.key?(:query_terms)
  @synonyms = args[:synonyms] if args.key?(:synonyms)
end