Class: Orchestrate::Search::RangeResult

Inherits:
AggregateResult show all
Defined in:
lib/orchestrate/search/results.rb

Overview

Range Aggregate result object

Direct Known Subclasses

DistanceResult, TimeSeriesResult

Instance Attribute Summary collapse

Attributes inherited from AggregateResult

#collection, #count, #field_name, #kind

Instance Method Summary collapse

Constructor Details

#initialize(collection, listing) ⇒ RangeResult

Initialize a new RangeResult object

Parameters:

  • collection (Orchestrate::Collection)

    The collection searched.

  • listing (#to_json)

    The aggregate result returned from the search.



183
184
185
186
# File 'lib/orchestrate/search/results.rb', line 183

def initialize(collection, listing)
  super(collection, listing)
  @buckets = listing['buckets']
end

Instance Attribute Details

#bucketsArray (readonly)

Returns Range buckets/sets results.

Returns:

  • (Array)

    Range buckets/sets results



178
179
180
# File 'lib/orchestrate/search/results.rb', line 178

def buckets
  @buckets
end

Instance Method Details

#to_sObject Also known as: inspect

Returns Pretty-Printed string representation of the RangeResult object.

Returns:

  • Pretty-Printed string representation of the RangeResult object



189
190
191
# File 'lib/orchestrate/search/results.rb', line 189

def to_s
  "#<Orchestrate::Search::RangeResult collection=#{collection.name} field_name=#{field_name} buckets=#{buckets}>"
end