class Tire::Search::DisMaxQuery

Public Class Methods

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

Public Instance Methods

query(&block) click to toggle source
# File lib/tire/search/query.rb, line 217
def query(&block)
  (@value[:queries] ||= []) << Query.new(&block).to_hash
  @value
end
to_hash() click to toggle source
# File lib/tire/search/query.rb, line 222
def to_hash
  @value.update(@options)
end
to_json(options={}) click to toggle source
# File lib/tire/search/query.rb, line 226
def to_json(options={})
  to_hash.to_json
end