Class: Sunspot::Query::BoostQuery
- Inherits:
-
Connective::Conjunction
- Object
- Connective::Abstract
- Connective::Conjunction
- Sunspot::Query::BoostQuery
- Defined in:
- lib/sunspot/query/boost_query.rb
Overview
Representation of a BoostQuery, which allows the searcher to specify a scope for which matching documents should have an extra boost. This is essentially a conjunction, with an extra instance variable containing the boost that should be applied.
Instance Method Summary collapse
-
#initialize(boost) ⇒ BoostQuery
constructor
:nodoc:.
- #to_boolean_phrase ⇒ 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_restriction, #add_shorthand_restriction, #negate, #negated?
Constructor Details
#initialize(boost) ⇒ BoostQuery
:nodoc:
10 11 12 13 |
# File 'lib/sunspot/query/boost_query.rb', line 10 def initialize(boost) super(false) @boost = boost end |
Instance Method Details
#to_boolean_phrase ⇒ Object
15 16 17 |
# File 'lib/sunspot/query/boost_query.rb', line 15 def to_boolean_phrase "#{super}^#{@boost}" end |