Class: Google::Apis::CloudsearchV1::FacetBucket
- Inherits:
-
Object
- Object
- Google::Apis::CloudsearchV1::FacetBucket
- 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
-
#count ⇒ Fixnum
Number of results that match the bucket value.
-
#percentage ⇒ Fixnum
Percent of results that match the bucket value.
-
#value ⇒ Google::Apis::CloudsearchV1::Value
Definition of a single value with generic type.
Instance Method Summary collapse
-
#initialize(**args) ⇒ FacetBucket
constructor
A new instance of FacetBucket.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ FacetBucket
Returns a new instance of FacetBucket.
7585 7586 7587 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 7585 def initialize(**args) update!(**args) end |
Instance Attribute Details
#count ⇒ Fixnum
Number of results that match the bucket value. Counts are only returned for
searches when count accuracy is ensured. Cloud Search does not guarantee facet
counts for any query and facet counts might be present only intermittently,
even for identical queries. Do not build dependencies on facet count existence;
instead use facet ount percentages which are always returned.
Corresponds to the JSON property count
7568 7569 7570 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 7568 def count @count end |
#percentage ⇒ Fixnum
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
7578 7579 7580 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 7578 def percentage @percentage end |
#value ⇒ Google::Apis::CloudsearchV1::Value
Definition of a single value with generic type.
Corresponds to the JSON property value
7583 7584 7585 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 7583 def value @value end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
7590 7591 7592 7593 7594 |
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 7590 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 |