Class: Sunspot::Query::QueryFieldFacet

Inherits:
QueryFacet
  • Object
show all
Defined in:
lib/sunspot/query/query_field_facet.rb

Instance Attribute Summary

Attributes inherited from QueryFacet

#field, #name

Instance Method Summary collapse

Methods inherited from QueryFacet

#add_row, #rows, #to_params

Constructor Details

#initialize(field, values) ⇒ QueryFieldFacet

Returns a new instance of QueryFieldFacet.



4
5
6
7
8
9
10
# File 'lib/sunspot/query/query_field_facet.rb', line 4

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