A FieldFacet is a facet whose rows are all values for a certain field, in contrast to a QueryFacet, whose rows represent arbitrary queries.
# File lib/sunspot/search/field_facet.rb, line 13 def field_name @field.name end
Get the rows returned for this facet.
Only return rows for which the referenced object exists in the data store. This option is ignored unless the field associated with this facet is configured with a :references argument.
Array of FacetRow objects
# File lib/sunspot/search/field_facet.rb, line 31 def rows(options = {}) if options[:verify] verified_rows else @rows ||= begin rows = super has_query_facets = !rows.empty? if @search.facet_response['facet_fields'] if data = @search.facet_response['facet_fields'][key] data.each_slice(2) do |value, count| row = FacetRow.new(@field.cast(value), count, self) rows << row end end end sort_rows!(rows) if has_query_facets rows end end end