class Tire::Search::ConstantScoreQuery

Public Class Methods

new(&block) click to toggle source
# File lib/tire/search/query.rb, line 185
def initialize(&block)
  @value = {}
  block.arity < 1 ? self.instance_eval(&block) : block.call(self) if block_given?
end

Public Instance Methods

boost(boost) click to toggle source
# File lib/tire/search/query.rb, line 201
def boost(boost)
  @value.update(:boost => boost)
end
filter(type, *options) click to toggle source
# File lib/tire/search/query.rb, line 190
def filter(type, *options)
  @value[:filter] ||= {}
  @value[:filter][:and] ||= []
  @value[:filter][:and] << Filter.new(type, *options).to_hash
  @value
end
query(&block) click to toggle source
# File lib/tire/search/query.rb, line 197
def query(&block)
  @value.update(:query => Query.new(&block).to_hash)
end
to_hash() click to toggle source
# File lib/tire/search/query.rb, line 205
def to_hash
  @value
end