class Sunspot::Query::QueryFacet
Public Class Methods
new(options = {}, negated = false)
click to toggle source
Calls superclass method
# File lib/sunspot/query/query_facet.rb, line 5 def initialize(options = {}, negated = false) if exclude_filters = options[:exclude] @exclude_tag = Util.Array(exclude_filters).map do |filter| filter.tag end.join(',') end super(negated) end
Public Instance Methods
to_boolean_phrase()
click to toggle source
# File lib/sunspot/query/query_facet.rb, line 26 def to_boolean_phrase "#{to_local_params}#{super}" end
to_params()
click to toggle source
# File lib/sunspot/query/query_facet.rb, line 15 def to_params if @components.empty? {} else { :facet => 'true', :"facet.query" => to_boolean_phrase } end end
Private Instance Methods
local_params()
click to toggle source
# File lib/sunspot/query/query_facet.rb, line 32 def local_params @local_params ||= begin local_params = {} local_params[:ex] = @exclude_tag if @exclude_tag local_params end end
to_local_params()
click to toggle source
# File lib/sunspot/query/query_facet.rb, line 41 def to_local_params if local_params.empty? '' else pairs = local_params.map do |key, value| "#{key}=#{value}" end "{!#{pairs.join(' ')}}" end end