Module: Chewy::Search::ClassMethods

Defined in:
lib/chewy/search.rb

Instance Method Summary collapse

Instance Method Details

#allObject



17
18
19
# File 'lib/chewy/search.rb', line 17

def all
  query_class.scopes.last || query_class.new(self)
end

#search_string(query, options = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/chewy/search.rb', line 21

def search_string query, options = {}
  options = options.merge(
    index: all._indexes.map(&:index_name),
    type: all._types.map(&:type_name),
    q: query)
  Chewy.client.search(options)
end