class Tire::Search::Filter

www.elasticsearch.org/guide/reference/api/search/filter.html www.elasticsearch.org/guide/reference/query-dsl/

Public Class Methods

new(type, *options) click to toggle source
# File lib/tire/search/filter.rb, line 9
def initialize(type, *options)
  value = if options.size < 2
    options.first || {}
  else
    options # An +or+ filter encodes multiple filters as an array
  end
  @hash = { type => value }
end

Public Instance Methods

to_hash() click to toggle source
# File lib/tire/search/filter.rb, line 22
def to_hash
  @hash
end
to_json() click to toggle source
# File lib/tire/search/filter.rb, line 18
def to_json
  to_hash.to_json
end