Sha256: 454b80b6b61b223ba2d769b32799cbff2a3330215709b376629028204c381c59

Contents?: true

Size: 544 Bytes

Versions: 2

Compression:

Stored size: 544 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, setup)
        super(setup)
        @boost = boost
      end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
benjaminkrause-sunspot-0.9.7 lib/sunspot/query/boost_query.rb
benjaminkrause-sunspot-0.9.8 lib/sunspot/query/boost_query.rb