Class: Sunspot::Query::BoostQuery

Inherits:
Connective::Conjunction show all
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

Methods inherited from Connective::Conjunction

inverse

Methods inherited from Connective::Abstract

#negate, #negated?, #to_params

Methods inherited from Scope

#add_component, #add_conjunction, #add_disjunction, #add_negated_restriction, #add_negated_shorthand_restriction, #add_restriction, #add_shorthand_restriction, #dynamic_query, #exclude_instance, #to_params

Constructor Details

#initialize(boost, setup) ⇒ BoostQuery

:nodoc:



10
11
12
13
# File 'lib/sunspot/query/boost_query.rb', line 10

def initialize(boost, setup)
  super(setup)
  @boost = boost
end

Instance Method Details

#to_boolean_phraseObject



15
16
17
# File 'lib/sunspot/query/boost_query.rb', line 15

def to_boolean_phrase
  "#{super}^#{@boost}"
end