lib/searchkick.rb in searchkick-0.5.3 vs lib/searchkick.rb in searchkick-0.6.0
- old
+ new
@@ -1,15 +1,25 @@
-require "tire"
+require "active_model"
+require "patron"
+require "elasticsearch"
require "searchkick/version"
+require "searchkick/index"
require "searchkick/reindex"
require "searchkick/results"
+require "searchkick/query"
require "searchkick/search"
require "searchkick/similar"
require "searchkick/model"
require "searchkick/tasks"
-require "searchkick/logger" if defined?(Rails)
+# TODO add logger
+# require "searchkick/logger" if defined?(Rails)
module Searchkick
+
+ def self.client
+ @client ||= Elasticsearch::Client.new(url: ENV["ELASTICSEARCH_URL"])
+ end
+
@callbacks = true
def self.enable_callbacks
@callbacks = true
end