class Sunspot::Search::StatsRow

Attributes

data[R]
value[R]

Public Instance Methods

count() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 20
def count
  data['count']
end
facet(name) click to toggle source
# File lib/sunspot/search/stats_row.rb, line 44
def facet name
  facets.find { |facet| facet.field.name == name.to_sym }
end
facets() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 48
def facets
  @facets ||= @facet_fields.map do |field|
    StatsFacet.new(field, data['facets'][field.indexed_name])
  end
end
inspect() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 61
def inspect
  "<Sunspot::Search::StatsRow:#{value.inspect} min=#{min} max=#{max} count=#{count}>"
end
instance() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 54
def instance
  if !defined?(@instance)
    @facet.populate_instances
  end
  @instance
end
max() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 16
def max
  data['max']
end
mean() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 36
def mean
  data['mean']
end
min() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 12
def min
  data['min']
end
missing() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 28
def missing
  data['missing']
end
standard_deviation() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 40
def standard_deviation
  data['stddev']
end
sum() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 24
def sum
  data['sum']
end
sum_of_squares() click to toggle source
# File lib/sunspot/search/stats_row.rb, line 32
def sum_of_squares
  data['sumOfSquares']
end