Class: Google::Apis::CloudsearchV1::EnumPropertyOptions

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

Overview

Options for enum properties, which allow you to define a restricted set of strings to match user queries, set rankings for those string values, and define an operator name to be paired with those strings so that users can narrow results to only items with a specific value. For example, for items in a request tracking system with priority information, you could define p0 as an allowable enum value and tie this enum to the operator name priority so that search users could add priority:p0 to their query to restrict the set of results to only those items indexed with the value p0.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ EnumPropertyOptions

Returns a new instance of EnumPropertyOptions.



995
996
997
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 995

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

Instance Attribute Details

#operator_optionsGoogle::Apis::CloudsearchV1::EnumOperatorOptions

Used to provide a search operator for enum properties. This is optional. Search operators let users restrict the query to specific fields relevant to the type of item being searched. For example, if you provide no operator for a priority enum property with possible values p0 and p1, a query that contains the term p0 returns items that have p0 as the value of the * priority* property, as well as any items that contain the string p0 in other fields. If you provide an operator name for the enum, such as priority, then search users can use that operator to refine results to only items that have * p0* as this property's value, with the query priority:p0. Corresponds to the JSON property operatorOptions



972
973
974
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 972

def operator_options
  @operator_options
end

#ordered_rankingString

Used to specify the ordered ranking for the enumeration that determines how the integer values provided in the possible EnumValuePairs are used to rank results. If specified, integer values must be provided for all possible EnumValuePair values given for this property. Can only be used if isRepeatable is false. Corresponds to the JSON property orderedRanking

Returns:

  • (String)


981
982
983
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 981

def ordered_ranking
  @ordered_ranking
end

#possible_valuesArray<Google::Apis::CloudsearchV1::EnumValuePair>

The list of possible values for the enumeration property. All EnumValuePairs must provide a string value. If you specify an integer value for one EnumValuePair, then all possible EnumValuePairs must provide an integer value. Both the string value and integer value must be unique over all possible values. Once set, possible values cannot be removed or modified. If you supply an ordered ranking and think you might insert additional enum values in the future, leave gaps in the initial integer values to allow adding a value in between previously registered values. The maximum number of elements is 100. Corresponds to the JSON property possibleValues



993
994
995
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 993

def possible_values
  @possible_values
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1000
1001
1002
1003
1004
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 1000

def update!(**args)
  @operator_options = args[:operator_options] if args.key?(:operator_options)
  @ordered_ranking = args[:ordered_ranking] if args.key?(:ordered_ranking)
  @possible_values = args[:possible_values] if args.key?(:possible_values)
end