# 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
# File lib/tire/search/query.rb, line 201 def boost(boost) @value.update(:boost => boost) end
# 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
# File lib/tire/search/query.rb, line 197 def query(&block) @value.update(:query => Query.new(&block).to_hash) end
# File lib/tire/search/query.rb, line 205 def to_hash @value end