Class: Sunspot::Search::FieldStats

Inherits:
StatsRow
  • Object
show all
Defined in:
lib/sunspot/search/field_stats.rb

Instance Attribute Summary

Attributes inherited from StatsRow

#instance, #value

Instance Method Summary collapse

Methods inherited from StatsRow

#count, #facet, #facets, #inspect, #max, #mean, #min, #missing, #standard_deviation, #sum, #sum_of_squares

Constructor Details

#initialize(field, search) ⇒ FieldStats

:nodoc:



4
5
6
# File 'lib/sunspot/search/field_stats.rb', line 4

def initialize(field, search) #:nodoc:
  @field, @search, @facet_fields = field, search, []
end

Instance Method Details

#add_facet(field) ⇒ Object



8
9
10
# File 'lib/sunspot/search/field_stats.rb', line 8

def add_facet field
  @facet_fields << field
end

#dataObject



16
17
18
# File 'lib/sunspot/search/field_stats.rb', line 16

def data
  @search.stats_response[@field.indexed_name]
end

#field_nameObject



12
13
14
# File 'lib/sunspot/search/field_stats.rb', line 12

def field_name
  @field.name
end