class Sunspot::Search::JsonFacetRow

Attributes

count[R]
nested[R]
value[R]

Public Instance Methods

inspect() click to toggle source
# File lib/sunspot/search/json_facet_row.rb, line 26
def inspect
  "<Sunspot::Search::FacetRow:#{value.inspect} (#{count}) #{nested.nil? ? '' : " nested_count=#{nested.size}"}>"
end
instance() click to toggle source

Return the instance referenced by this facet row. Only valid for field facets whose fields are defined with the :references key.

# File lib/sunspot/search/json_facet_row.rb, line 19
def instance
  if !defined?(@instance)
    @facet.populate_instances
  end
  @instance
end

Private Instance Methods

recursive_nested_initialization(data) click to toggle source
# File lib/sunspot/search/json_facet_row.rb, line 32
def recursive_nested_initialization(data)
  data[@nested_key]['buckets'].map do |d|
    JsonFacetRow.new(d, @facet)
  end
end