Module: Searchkick
- Defined in:
- lib/searchkick/logging.rb,
lib/searchkick.rb,
lib/searchkick/index.rb,
lib/searchkick/model.rb,
lib/searchkick/query.rb,
lib/searchkick/results.rb,
lib/searchkick/version.rb,
lib/searchkick/reindex_job.rb,
lib/searchkick/reindex_v2_job.rb
Overview
based on gist.github.com/mnutt/566725
Defined Under Namespace
Modules: ControllerRuntime, Model, Reindex Classes: DangerousOperation, Error, ImportError, Index, InvalidQueryError, LogSubscriber, MissingIndexError, Query, ReindexJob, ReindexV2Job, Results, UnsupportedVersionError
Constant Summary collapse
- VERSION =
"1.1.1"
Class Attribute Summary collapse
- .client ⇒ Object
- .env ⇒ Object
-
.models ⇒ Object
Returns the value of attribute models.
-
.search_method_name ⇒ Object
Returns the value of attribute search_method_name.
-
.timeout ⇒ Object
Returns the value of attribute timeout.
-
.wordnet_path ⇒ Object
Returns the value of attribute wordnet_path.
Class Method Summary collapse
- .callbacks? ⇒ Boolean
- .disable_callbacks ⇒ Object
- .enable_callbacks ⇒ Object
- .server_version ⇒ Object
Class Attribute Details
.client ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/searchkick.rb', line 41 def self.client @client ||= Elasticsearch::Client.new( url: ENV["ELASTICSEARCH_URL"], transport_options: {request: {timeout: timeout}} ) end |
.env ⇒ Object
69 70 71 |
# File 'lib/searchkick.rb', line 69 def self.env @env ||= ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" end |
.models ⇒ Object
Returns the value of attribute models.
33 34 35 |
# File 'lib/searchkick.rb', line 33 def models @models end |
.search_method_name ⇒ Object
Returns the value of attribute search_method_name.
30 31 32 |
# File 'lib/searchkick.rb', line 30 def search_method_name @search_method_name end |
.timeout ⇒ Object
Returns the value of attribute timeout.
32 33 34 |
# File 'lib/searchkick.rb', line 32 def timeout @timeout end |
.wordnet_path ⇒ Object
Returns the value of attribute wordnet_path.
31 32 33 |
# File 'lib/searchkick.rb', line 31 def wordnet_path @wordnet_path end |
Class Method Details
.callbacks? ⇒ Boolean
65 66 67 |
# File 'lib/searchkick.rb', line 65 def self.callbacks? Thread.current[:searchkick_callbacks_enabled].nil? || Thread.current[:searchkick_callbacks_enabled] end |
.disable_callbacks ⇒ Object
61 62 63 |
# File 'lib/searchkick.rb', line 61 def self.disable_callbacks Thread.current[:searchkick_callbacks_enabled] = false end |
.enable_callbacks ⇒ Object
57 58 59 |
# File 'lib/searchkick.rb', line 57 def self.enable_callbacks Thread.current[:searchkick_callbacks_enabled] = true end |
.server_version ⇒ Object
53 54 55 |
# File 'lib/searchkick.rb', line 53 def self.server_version @server_version ||= client.info["version"]["number"] end |