Class: Sunspot::Query::FieldFacet

Inherits:
AbstractFieldFacet show all
Defined in:
lib/sunspot/query/field_facet.rb

Instance Method Summary collapse

Constructor Details

#initialize(field, options) ⇒ FieldFacet

Returns a new instance of FieldFacet.



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

def initialize(field, options)
  if exclude_filters = options[:exclude]
    @exclude_tag = Util.Array(exclude_filters).map do |filter|
      filter.tag
    end.join(',')
  end
  super
end

Instance Method Details

#to_paramsObject



13
14
15
# File 'lib/sunspot/query/field_facet.rb', line 13

def to_params
  super.merge(:"facet.field" => [field_name_with_local_params])
end