Method: Tire::Search::MatchQuery.add
- Defined in:
- lib/tire/search/queries/match.rb
.add(query, field, value, options = {}) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/tire/search/queries/match.rb', line 26 def self.add(query, field, value, ={}) unless query.value[:bool] original_value = query.value.dup query.value = { :bool => {} } (query.value[:bool][:must] ||= []) << original_value end query.value[:bool][:must] << MatchQuery.new(field, value, ).to_hash end |