Class: Sunspot::Query::QueryFieldFacet
- Inherits:
-
QueryFacet
- Object
- QueryFacet
- Sunspot::Query::QueryFieldFacet
- Defined in:
- lib/sunspot/query/query_field_facet.rb
Overview
QueryFieldFacets are used for the “restricted field facet” feature, which allows an :only parameter for field facets, specifying a set of values in which the searcher is interested. Since Solr does not support this feature directly in field facets, build query facets that replicate field facet behavior.
Instance Attribute Summary
Attributes inherited from QueryFacet
Instance Method Summary collapse
-
#initialize(field, values, options) ⇒ QueryFieldFacet
constructor
:nodoc:.
Methods inherited from QueryFacet
Constructor Details
#initialize(field, values, options) ⇒ QueryFieldFacet
:nodoc:
11 12 13 14 15 16 17 |
# File 'lib/sunspot/query/query_field_facet.rb', line 11 def initialize(field, values, ) super(field.name, ) @field = field values.each do |value| add_row(value).add_component(Restriction::EqualTo.new(field, value)) end end |