Class: Sunspot::Query::CompositeFulltext
- Inherits:
-
Object
- Object
- Sunspot::Query::CompositeFulltext
- Defined in:
- lib/sunspot/query/composite_fulltext.rb
Instance Method Summary collapse
- #add(keywords) ⇒ Object
-
#initialize ⇒ CompositeFulltext
constructor
A new instance of CompositeFulltext.
- #to_params ⇒ Object
Constructor Details
#initialize ⇒ CompositeFulltext
Returns a new instance of CompositeFulltext.
4 5 6 |
# File 'lib/sunspot/query/composite_fulltext.rb', line 4 def initialize @components = [] end |
Instance Method Details
#add(keywords) ⇒ Object
8 9 10 11 |
# File 'lib/sunspot/query/composite_fulltext.rb', line 8 def add(keywords) @components << dismax = Dismax.new(keywords) dismax end |
#to_params ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sunspot/query/composite_fulltext.rb', line 13 def to_params case @components.length when 0 {} when 1 @components.first.to_params else to_subqueries end end |