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.



8864
8865
8866
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 8864

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

Returns:

  • (Fixnum)


8837
8838
8839
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 8837

def count
  @count
end

#filterGoogle::Apis::CloudsearchV1::Filter

A generic way of expressing filters in a query, which supports two approaches: 1. Setting a ValueFilter. The name must match an operator_name defined in the schema for your data source. 2. Setting a CompositeFilter. The filters are evaluated using the logical operator. The top-level operators can only be either an AND or a NOT. AND can appear only at the top-most level. OR can appear only under a top-level AND. Corresponds to the JSON property filter



8847
8848
8849
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 8847

def filter
  @filter
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)


8857
8858
8859
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 8857

def percentage
  @percentage
end

#valueGoogle::Apis::CloudsearchV1::Value

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



8862
8863
8864
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 8862

def value
  @value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



8869
8870
8871
8872
8873
8874
# File 'lib/google/apis/cloudsearch_v1/classes.rb', line 8869

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