module Searchkick

based on gist.github.com/mnutt/566725

Constants

VERSION

Attributes

client[W]
models[RW]
search_method_name[RW]
timeout[RW]
wordnet_path[RW]

Public Class Methods

callbacks?() click to toggle source
# File lib/searchkick.rb, line 61
def self.callbacks?
  Thread.current[:searchkick_callbacks_enabled].nil? || Thread.current[:searchkick_callbacks_enabled]
end
client() click to toggle source
# File lib/searchkick.rb, line 37
def self.client
  @client ||=
    Elasticsearch::Client.new(
      url: ENV["ELASTICSEARCH_URL"],
      transport_options: {request: {timeout: timeout}}
    )
end
disable_callbacks() click to toggle source
# File lib/searchkick.rb, line 57
def self.disable_callbacks
  Thread.current[:searchkick_callbacks_enabled] = false
end
enable_callbacks() click to toggle source
# File lib/searchkick.rb, line 53
def self.enable_callbacks
  Thread.current[:searchkick_callbacks_enabled] = true
end
env() click to toggle source
# File lib/searchkick.rb, line 65
def self.env
  @env ||= ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
end
server_version() click to toggle source
# File lib/searchkick.rb, line 49
def self.server_version
  @server_version ||= client.info["version"]["number"]
end