Class: Sunspot::Query::QueryFacet
- Inherits:
-
Connective::Conjunction
- Object
- Connective::Abstract
- Connective::Conjunction
- Sunspot::Query::QueryFacet
- Defined in:
- lib/sunspot/query/query_facet.rb
Instance Method Summary collapse
-
#initialize(options = {}, negated = false) ⇒ QueryFacet
constructor
A new instance of QueryFacet.
- #to_boolean_phrase ⇒ Object
- #to_params ⇒ Object
Methods inherited from Connective::Conjunction
Methods inherited from Connective::Abstract
#add_component, #add_conjunction, #add_disjunction, #add_negated_restriction, #add_negated_shorthand_restriction, #add_positive_restriction, #add_positive_shorthand_restriction, #add_restriction, #add_shorthand_restriction, #negate, #negated?
Methods included from Filter
Constructor Details
#initialize(options = {}, negated = false) ⇒ QueryFacet
Returns a new instance of QueryFacet.
5 6 7 8 9 10 11 12 |
# File 'lib/sunspot/query/query_facet.rb', line 5 def initialize( = {}, negated = false) if exclude_filters = [:exclude] @exclude_tag = Util.Array(exclude_filters).map do |filter| filter.tag end.join(',') end super(negated) end |
Instance Method Details
#to_boolean_phrase ⇒ Object
26 27 28 |
# File 'lib/sunspot/query/query_facet.rb', line 26 def to_boolean_phrase "#{to_local_params}#{super}" end |
#to_params ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# 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 |