Class: Google::Apis::CloudsearchV1::FacetBucket

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

Overview

A bucket in a facet is the basic unit of operation. A bucket can comprise either a single value OR a contiguous range of values, depending on the type of the field bucketed. FacetBucket is currently used only for returning the response object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ FacetBucket

Returns a new instance of FacetBucket



885
886
887
# File 'generated/google/apis/cloudsearch_v1/classes.rb', line 885

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

Instance Attribute Details

#countFixnum

Number of results that match the bucket value. Corresponds to the JSON property count

Returns:

  • (Fixnum)


871
872
873
# File 'generated/google/apis/cloudsearch_v1/classes.rb', line 871

def count
  @count
end

#percentageFixnum

Percent of results that match the bucket value. This value is between (0-100]. This may not be accurate and is a best effort estimate. Corresponds to the JSON property percentage

Returns:

  • (Fixnum)


878
879
880
# File 'generated/google/apis/cloudsearch_v1/classes.rb', line 878

def percentage
  @percentage
end

#valueGoogle::Apis::CloudsearchV1::Value

Definition of a single value with generic type. Corresponds to the JSON property value



883
884
885
# File 'generated/google/apis/cloudsearch_v1/classes.rb', line 883

def value
  @value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



890
891
892
893
894
# File 'generated/google/apis/cloudsearch_v1/classes.rb', line 890

def update!(**args)
  @count = args[:count] if args.key?(:count)
  @percentage = args[:percentage] if args.key?(:percentage)
  @value = args[:value] if args.key?(:value)
end