lib/elastic/enterprise-search/client.rb in elastic-enterprise-search-7.14.0 vs lib/elastic/enterprise-search/client.rb in elastic-enterprise-search-7.14.1

- old
+ new

@@ -65,11 +65,11 @@ @transport = transport end def transport @options[:transport] || - Elasticsearch::Client.new( + transport_klass.new( host: host, log: log, logger: logger, request_timeout: overall_timeout, transport_options: { @@ -107,9 +107,20 @@ return DEFAULT_HOST unless @options[:host] raise URI::InvalidURIError unless @options[:host] =~ /\A#{URI::DEFAULT_PARSER.make_regexp}\z/ @options[:host] + end + + private + + def transport_klass + case Elasticsearch::Transport::VERSION + when /7\.1[123]/ + Elasticsearch::Client + else + Elasticsearch::Transport::Client + end end end end end