module EagleSearch::Model::ClassMethods
Public Instance Methods
create_index()
click to toggle source
# File lib/eagle_search/model.rb, line 12 def create_index eagle_search_index.create end
delete_index()
click to toggle source
# File lib/eagle_search/model.rb, line 16 def delete_index eagle_search_index.delete end
eagle_search(settings = {})
click to toggle source
# File lib/eagle_search/model.rb, line 4 def eagle_search(settings = {}) @index = EagleSearch::Index.new(self, settings) end
eagle_search_index()
click to toggle source
# File lib/eagle_search/model.rb, line 8 def eagle_search_index @index end
index_info()
click to toggle source
# File lib/eagle_search/model.rb, line 24 def index_info eagle_search_index.info end
refresh_index()
click to toggle source
# File lib/eagle_search/model.rb, line 20 def refresh_index eagle_search_index.refresh end
reindex()
click to toggle source
# File lib/eagle_search/model.rb, line 34 def reindex eagle_search_index.reindex end
search(term, options = {})
click to toggle source
# File lib/eagle_search/model.rb, line 28 def search(term, options = {}) interpreter = EagleSearch::Interpreter.new(@index, term, options) search_response = EagleSearch.client.search index: eagle_search_index.alias_name, body: interpreter.payload EagleSearch::Response.new(self, search_response, options) end