Class: Skala::ElasticsearchAdapter
- Defined in:
- lib/skala/elasticsearch_adapter.rb
Defined Under Namespace
Classes: Search
Instance Attribute Summary collapse
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#index ⇒ Object
Returns the value of attribute index.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#elasticsearch_client ⇒ Object
internal api between adapter and operations.
-
#initialize(options = {}) ⇒ ElasticsearchAdapter
constructor
A new instance of ElasticsearchAdapter.
Methods inherited from Adapter
#authenticate_user, #create_user_hold_request, #delete_user_hold_request, #get_record_holdable_items, #get_record_items, #get_records, #get_user, #get_user_cash, #get_user_former_loans, #get_user_hold_requests, #get_user_inter_library_loans, #get_user_loans, #get_user_transactions, #renew_user_loan, #renew_user_loans, #search, #update_user
Constructor Details
#initialize(options = {}) ⇒ ElasticsearchAdapter
Returns a new instance of ElasticsearchAdapter.
18 19 20 21 22 23 24 25 |
# File 'lib/skala/elasticsearch_adapter.rb', line 18 def initialize( = {}) HashWithIndifferentAccess.new().try do || self.hosts = [:hosts] || [:host] || [:urls] || [:url] self.index = [:index] self.timeout = [:timeout] self.type = [:type] end end |
Instance Attribute Details
#hosts ⇒ Object
Returns the value of attribute hosts.
9 10 11 |
# File 'lib/skala/elasticsearch_adapter.rb', line 9 def hosts @hosts end |
#index ⇒ Object
Returns the value of attribute index.
10 11 12 |
# File 'lib/skala/elasticsearch_adapter.rb', line 10 def index @index end |
#timeout ⇒ Object
Returns the value of attribute timeout.
11 12 13 |
# File 'lib/skala/elasticsearch_adapter.rb', line 11 def timeout @timeout end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'lib/skala/elasticsearch_adapter.rb', line 12 def type @type end |
Instance Method Details
#elasticsearch_client ⇒ Object
internal api between adapter and operations
30 31 32 |
# File 'lib/skala/elasticsearch_adapter.rb', line 30 def elasticsearch_client Elasticsearch::Client.new hosts: @hosts end |