Module: EagleSearch

Defined in:
lib/eagle_search.rb,
lib/eagle_search/field.rb,
lib/eagle_search/index.rb,
lib/eagle_search/model.rb,
lib/eagle_search/version.rb,
lib/eagle_search/response.rb,
lib/eagle_search/interpreter.rb,
lib/eagle_search/interpreter/query.rb,
lib/eagle_search/interpreter/filter.rb

Defined Under Namespace

Classes: Field, Index, Interpreter, Model, Response

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.clientObject



18
19
20
# File 'lib/eagle_search.rb', line 18

def self.client
  @client ||= Elasticsearch::Client.new
end

.envObject



22
23
24
# File 'lib/eagle_search.rb', line 22

def self.env
  @env ||= ENV['RAILS_ENV'] || "development"
end

.included(base) ⇒ Object



12
13
14
15
16
# File 'lib/eagle_search.rb', line 12

def self.included(base)
  base.extend(EagleSearch::Model::ClassMethods)
  base.include(EagleSearch::Model::InstanceMethods)
  base.after_commit :reindex, on: [:create, :update]
end