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,
lib/eagle_search/interpreter/aggregation.rb

Defined Under Namespace

Classes: Field, Index, Interpreter, Model, Response

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.clientObject



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

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

.envObject



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

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

.included(base) ⇒ Object



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

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