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

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

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

Constructor Details

#initialize(**args) ⇒ FacetBucket

Returns a new instance of FacetBucket.



1067
1068
1069
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 1067

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

Instance Attribute Details

#countFixnum

Number of results that match the bucket value. Counts are only returned for searches when count accuracy is ensured. Can be empty. Corresponds to the JSON property count

Returns:

  • (Fixnum)


1050
1051
1052
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 1050

def count
  @count
end

#percentageFixnum

Percent of results that match the bucket value. The returned value is between ( 0-100], and is rounded down to an integer if fractional. If the value is not explicitly returned, it represents a percentage value that rounds to 0. Percentages are returned for all searches, but are an estimate. Because percentages are always returned, you should render percentages instead of counts. Corresponds to the JSON property percentage

Returns:

  • (Fixnum)


1060
1061
1062
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 1060

def percentage
  @percentage
end

#valueGoogle::Apis::CloudsearchV1::Value

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



1065
1066
1067
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 1065

def value
  @value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1072
1073
1074
1075
1076
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 1072

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