Skip to content

Commit 4f365ca

Browse files
committed
Update READMES
1 parent 57ad51a commit 4f365ca

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ Both of these libraries are extensively documented.
7272
and the [`elasticsearch-api`](http://rubydoc.info/gems/elasticsearch-api) documentation carefully.**
7373

7474
_Keep in mind, that for optimal performance, you should use a HTTP library which supports persistent
75-
("keep-alive") connections, e.g. [Patron](https://github.com/toland/patron) or
76-
[Typhoeus](https://github.com/typhoeus/typhoeus)._ These libraries are not dependencies of the elasticsearch gems, so
77-
be sure to define a dependency in your own application.
75+
("keep-alive") connections, e.g. [Patron](https://github.com/toland/patron)._ These libraries are not dependencies of the elasticsearch gems, so be sure to define a dependency in your own application.
7876

7977
This repository contains these additional Ruby libraries:
8078

elasticsearch-transport/README.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ Features overview:
2828
* Node reloading (based on cluster state) on errors or on demand
2929

3030
For optimal performance, use a HTTP library which supports persistent ("keep-alive") connections,
31-
such as [Typhoeus](https://github.com/typhoeus/typhoeus).
32-
Just require the library (`require 'typhoeus'; require 'typhoeus/adapters/faraday'`) in your code,
33-
and it will be automatically used; currently these libraries will be automatically detected and used:
34-
[Patron](https://github.com/toland/patron),
35-
[HTTPClient](https://rubygems.org/gems/httpclient) and
36-
[Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent).
31+
such as [patron](https://github.com/toland/patron).
32+
Just require the library (`require 'patron'`) in your code,
33+
and it will be automatically used.
34+
35+
Currently these libraries will be automatically detected and used:
36+
- [Patron](https://github.com/toland/patron)
37+
- [HTTPClient](https://rubygems.org/gems/httpclient)
38+
- [Net::HTTP::Persistent](https://rubygems.org/gems/net-http-persistent)
39+
40+
**Note on [Typhoeus](https://github.com/typhoeus/typhoeus)**: Typhoeus is compatible and will be automatically detected too. However, the latest release (v1.3.1 at the moment of writing this) is not compatible with Faraday 1.0. [It still uses the deprecated `Faraday::Error` namespace](https://github.com/typhoeus/typhoeus/blob/v1.3.1/lib/typhoeus/adapters/faraday.rb#L100). If you want to use it with this gem, we suggest getting `master` from GitHub, since this has been fixed for v1.4.0. We'll update this if/when v1.4.0 is released.a
3741

3842
For detailed information, see example configurations [below](#transport-implementations).
3943

@@ -351,34 +355,35 @@ constructor, use the `transport_options` key:
351355

352356
To configure the _Faraday_ instance directly, use a block:
353357

354-
require 'typhoeus'
355-
require 'typhoeus/adapters/faraday'
358+
require 'patron'
356359

357360
client = Elasticsearch::Client.new(host: 'localhost', port: '9200') do |f|
358361
f.response :logger
359-
f.adapter :typhoeus
362+
f.adapter :patron
360363
end
361364

362365
You can use any standard Faraday middleware and plugins in the configuration block, for example sign the requests for the [AWS Elasticsearch service](https://aws.amazon.com/elasticsearch-service/). See [the AWS documentation](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-request-signing.html#es-request-signing-ruby) for an example.
363366

364367
You can also initialize the transport class yourself, and pass it to the client constructor
365368
as the `transport` argument:
366369

367-
require 'typhoeus'
368-
require 'typhoeus/adapters/faraday'
370+
```ruby
371+
require 'patron'
369372

370-
transport_configuration = lambda do |f|
371-
f.response :logger
372-
f.adapter :typhoeus
373-
end
373+
transport_configuration = lambda do |f|
374+
f.response :logger
375+
f.adapter :patron
376+
end
374377

375-
transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \
376-
hosts: [ { host: 'localhost', port: '9200' } ],
377-
&transport_configuration
378+
transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \
379+
hosts: [ { host: 'localhost', port: '9200' } ],
380+
&transport_configuration
381+
382+
# Pass the transport to the client
383+
#
384+
client = Elasticsearch::Client.new transport: transport
385+
```
378386

379-
# Pass the transport to the client
380-
#
381-
client = Elasticsearch::Client.new transport: transport
382387

383388
Instead of passing the transport to the constructor, you can inject it at run time:
384389

0 commit comments

Comments
 (0)