Module: EagleSearch::Model::ClassMethods
- Defined in:
- lib/eagle_search/model.rb
Instance Method Summary collapse
- #create_index ⇒ Object
- #delete_index ⇒ Object
- #eagle_search(settings = {}) ⇒ Object
- #eagle_search_index ⇒ Object
- #index_info ⇒ Object
- #refresh_index ⇒ Object
- #reindex ⇒ Object
- #search(term, options = {}) ⇒ Object
Instance Method Details
#create_index ⇒ Object
12 13 14 |
# File 'lib/eagle_search/model.rb', line 12 def create_index eagle_search_index.create end |
#delete_index ⇒ Object
16 17 18 |
# File 'lib/eagle_search/model.rb', line 16 def delete_index eagle_search_index.delete end |
#eagle_search(settings = {}) ⇒ Object
4 5 6 |
# File 'lib/eagle_search/model.rb', line 4 def eagle_search(settings = {}) @index = EagleSearch::Index.new(self, settings) end |
#eagle_search_index ⇒ Object
8 9 10 |
# File 'lib/eagle_search/model.rb', line 8 def eagle_search_index @index end |
#index_info ⇒ Object
24 25 26 |
# File 'lib/eagle_search/model.rb', line 24 def index_info eagle_search_index.info end |
#refresh_index ⇒ Object
20 21 22 |
# File 'lib/eagle_search/model.rb', line 20 def refresh_index eagle_search_index.refresh end |
#reindex ⇒ Object
34 35 36 |
# File 'lib/eagle_search/model.rb', line 34 def reindex eagle_search_index.reindex end |
#search(term, options = {}) ⇒ Object
28 29 30 31 32 |
# File 'lib/eagle_search/model.rb', line 28 def search(term, = {}) interpreter = EagleSearch::Interpreter.new(@index, term, ) search_response = EagleSearch.client.search index: eagle_search_index.alias_name, body: interpreter.payload EagleSearch::Response.new(self, search_response, ) end |