Module: Elasticsearch::Rails2::ClassMethods
- Included in:
- Elasticsearch::Rails2
- Defined in:
- lib/elasticsearch/rails2.rb
Instance Method Summary collapse
-
#client ⇒ Object
Get the client common for all models.
-
#client=(client) ⇒ Object
Set the client for all models.
- #options=(options = {}) ⇒ Object
Instance Method Details
#client ⇒ Object
Get the client common for all models
37 38 39 |
# File 'lib/elasticsearch/rails2.rb', line 37 def client @client ||= Elasticsearch::Client.new end |
#client=(client) ⇒ Object
Note:
You have to set the client before you call Elasticsearch methods on the model, or set it directly on the model; see Model::Client::ClassMethods#client
Set the client for all models
51 52 53 |
# File 'lib/elasticsearch/rails2.rb', line 51 def client=(client) @client = client end |
#options=(options = {}) ⇒ Object
55 56 57 58 59 |
# File 'lib/elasticsearch/rails2.rb', line 55 def (={}) Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end end |