Skip to content

Commit 021d041

Browse files
committed
Update READMES
1 parent c135f7d commit 021d041

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
@@ -77,9 +77,7 @@ Both of these libraries are extensively documented.
7777
and the [`elasticsearch-api`](http://rubydoc.info/gems/elasticsearch-api) documentation carefully.**
7878

7979
_Keep in mind, that for optimal performance, you should use a HTTP library which supports persistent
80-
("keep-alive") connections, e.g. [Patron](https://github.com/toland/patron) or
81-
[Typhoeus](https://github.com/typhoeus/typhoeus)._ These libraries are not dependencies of the elasticsearch gems, so
82-
be sure to define a dependency in your own application.
80+
("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.
8381

8482
This repository contains these additional Ruby libraries:
8583

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

@@ -366,34 +370,35 @@ constructor, use the `transport_options` key:
366370

367371
To configure the _Faraday_ instance directly, use a block:
368372

369-
require 'typhoeus'
370-
require 'typhoeus/adapters/faraday'
373+
require 'patron'
371374

372375
client = Elasticsearch::Client.new(host: 'localhost', port: '9200') do |f|
373376
f.response :logger
374-
f.adapter :typhoeus
377+
f.adapter :patron
375378
end
376379

377380
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.
378381

379382
You can also initialize the transport class yourself, and pass it to the client constructor
380383
as the `transport` argument:
381384

382-
require 'typhoeus'
383-
require 'typhoeus/adapters/faraday'
385+
```ruby
386+
require 'patron'
384387

385-
transport_configuration = lambda do |f|
386-
f.response :logger
387-
f.adapter :typhoeus
388-
end
388+
transport_configuration = lambda do |f|
389+
f.response :logger
390+
f.adapter :patron
391+
end
389392

390-
transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \
391-
hosts: [ { host: 'localhost', port: '9200' } ],
392-
&transport_configuration
393+
transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new \
394+
hosts: [ { host: 'localhost', port: '9200' } ],
395+
&transport_configuration
396+
397+
# Pass the transport to the client
398+
#
399+
client = Elasticsearch::Client.new transport: transport
400+
```
393401

394-
# Pass the transport to the client
395-
#
396-
client = Elasticsearch::Client.new transport: transport
397402

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

0 commit comments

Comments
 (0)