Sha256: 114f818113da5a3fc8c2b16e0def416561cb128754d300f8a3976fd38fc59b2b

Contents?: true

Size: 625 Bytes

Versions: 63

Compression:

Stored size: 625 Bytes

Contents

module Sunspot
  module Query
    # 
    # 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.
    #
    class BoostQuery < Connective::Conjunction #:nodoc:
      def initialize(boost)
        super(false)
        @boost = boost
      end

      def to_boolean_phrase
        if @boost.is_a?(FunctionQuery)
          "#{@boost}"
        else
          "#{super}^#{@boost}"
        end
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 12 rubygems

Version Path
sunspot-2.7.1 lib/sunspot/query/boost_query.rb
sunspot-2.7.0 lib/sunspot/query/boost_query.rb
sunspot-2.6.0 lib/sunspot/query/boost_query.rb
sunspot-2.5.0 lib/sunspot/query/boost_query.rb
sunspot-2.4.0 lib/sunspot/query/boost_query.rb
sunspot-2.3.0 lib/sunspot/query/boost_query.rb
sunspot-2.2.8 lib/sunspot/query/boost_query.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sunspot-2.2.7/lib/sunspot/query/boost_query.rb
sunspot-2.2.7 lib/sunspot/query/boost_query.rb
sunspot-2.2.6 lib/sunspot/query/boost_query.rb
sunspot-2.2.5 lib/sunspot/query/boost_query.rb
sunspot-2.2.4 lib/sunspot/query/boost_query.rb
sunspot-2.2.3 lib/sunspot/query/boost_query.rb
sunspot-2.2.2 lib/sunspot/query/boost_query.rb
sunspot-2.2.1 lib/sunspot/query/boost_query.rb
sunspot-2.2.0 lib/sunspot/query/boost_query.rb
sunspot-2.1.1 lib/sunspot/query/boost_query.rb
sunspot-2.1.0 lib/sunspot/query/boost_query.rb
sunspot-2.0.0 lib/sunspot/query/boost_query.rb
sunspot-2.0.0.pre.130115 lib/sunspot/query/boost_query.rb