Skip to content

Commit

Permalink
support nested query
Browse files Browse the repository at this point in the history
  • Loading branch information
fcheung committed Jul 31, 2012
1 parent 1488a3c commit c2569d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/tire/search/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ def string(value, options={})
@value
end


def nested(options={},&block)
@nested ||= Query.new(&block)
@value[:nested] = options
@value[:nested].update({:query => @nested.to_hash})
@value
end

def custom_filters_score(options={}, &block)
@custom_filters ||= CustomFiltersScoreQuery.new(options)
block.arity < 1 ? @custom_filters.instance_eval(&block) : block.call(@custom_filters) if block_given?
Expand Down

0 comments on commit c2569d0

Please sign in to comment.