Sha256: 8d2002335a23b05e9f8aea7c5479ffab8c71810ef73bfc5c40ac33fee77e0ebf
Contents?: true
Size: 849 Bytes
Versions: 1
Compression:
Stored size: 849 Bytes
Contents
require "active_support" require "active_support/core_ext" require "elasticsearch" require "skala/adapter" class Skala::ElasticsearchAdapter < Skala::Adapter require_relative "elasticsearch_adapter/search" attr_accessor :hosts attr_accessor :index attr_accessor :timeout attr_accessor :type def hosts=(value) @hosts = value.try(:map) { |host| host.deep_symbolize_keys } end def initialize(options = {}) HashWithIndifferentAccess.new(options).try do |_options| self.hosts = _options[:hosts] || _options[:host] || _options[:urls] || _options[:url] self.index = _options[:index] self.timeout = _options[:timeout] self.type = _options[:type] end end # # internal api between adapter and operations # def elasticsearch_client Elasticsearch::Client.new hosts: @hosts end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
skala-1.1.0 | lib/skala/elasticsearch_adapter.rb |