Class: Sunspot::Query::QueryFacet

Inherits:
Connective::Conjunction show all
Defined in:
lib/sunspot/query/query_facet.rb

Instance Method Summary collapse

Methods inherited from Connective::Conjunction

#add_conjunction, inverse

Methods inherited from Connective::Abstract

#add_component, #add_conjunction, #add_disjunction, #add_negated_restriction, #add_negated_shorthand_restriction, #add_restriction, #add_shorthand_restriction, #initialize, #negate, #negated?, #to_boolean_phrase

Constructor Details

This class inherits a constructor from Sunspot::Query::Connective::Abstract

Instance Method Details

#to_paramsObject



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

def to_params
  if @components.empty?
    {}
  else
    {
      :facet => 'true',
      :"facet.query" => to_boolean_phrase
    }
  end
end