README.md in elasticsearch-transport-1.0.6 vs README.md in elasticsearch-transport-1.0.7
- old
+ new
@@ -87,25 +87,45 @@
Instead of Strings, you can pass host information as an array of Hashes:
Elasticsearch::Client.new hosts: [ { host: 'myhost1', port: 8080 }, { host: 'myhost2', port: 8080 } ]
+Common URL parts -- scheme, HTTP authentication credentials, URL prefixes, etc -- are handled automatically:
+
+ Elasticsearch::Client.new url: 'https://username:password@api.server.org:4430/search'
+
+You can pass multiple URLs separated by a comma:
+
+ Elasticsearch::Client.new urls: 'http://localhost:9200,http://localhost:9201'
+
+Another way to configure the URL(s) is to export the `ELASTICSEARCH_URL` variable.
+
+The client will automatically round-robin across the hosts
+(unless you select or implement a different [connection selector](#connection-selector)).
+
+### Authentication
+
+You can pass the authentication credentials, scheme and port in the host configuration hash:
+
Elasticsearch::Client.new hosts: [
{ host: 'my-protected-host',
port: '443',
user: 'USERNAME',
password: 'PASSWORD',
scheme: 'https'
} ]
-Scheme, HTTP authentication credentials and URL prefixes are handled automatically:
+... or simply use the common URL format:
- Elasticsearch::Client.new url: 'https://username:password@api.server.org:4430/search'
+ Elasticsearch::Client.new url: 'https://username:password@example.com:9200'
-The client will automatically round-robin across the hosts
-(unless you select or implement a different [connection selector](#connection-selector)).
+To pass a custom certificate for SSL peer verification to Faraday-based clients,
+use the `transport_options` option:
+ Elasticsearch::Client.new url: 'https://username:password@example.com:9200',
+ transport_options: { ssl: { ca_file: '/path/to/cacert.pem' } }
+
### Logging
To log requests and responses to standard output with the default logger (an instance of Ruby's {::Logger} class),
set the `log` argument:
@@ -260,11 +280,12 @@
constructor, use the `transport_options` key:
client = Elasticsearch::Client.new transport_options: {
request: { open_timeout: 1 },
headers: { user_agent: 'MyApp' },
- params: { :format => 'yaml' }
+ params: { :format => 'yaml' },
+ ssl: { verify: false }
}
You can also use a bundled [_Curb_](https://rubygems.org/gems/curb) based transport implementation:
require 'curb'
@@ -371,9 +392,25 @@
* {Elasticsearch::Transport::Transport::Connections::Connection} contains the connection attributes such as hostname and port,
as well as the concrete persistent "session" connected to a specific node.
* The {Elasticsearch::Transport::Transport::Connections::Selector::Base} implementations allow to choose connections
from the pool, eg. in a round-robin or random fashion. You can implement your own selector strategy.
+
+## Development
+
+To work on the code, clone and bootstrap the main repository first --
+please see instructions in the main [README](../README.md#development).
+
+To run tests, launch a testing cluster -- again, see instructions
+in the main [README](../README.md#development) -- and use the Rake tasks:
+
+```
+time rake test:unit
+time rake test:integration
+```
+
+Unit tests have to use Ruby 1.8 compatible syntax, integration tests
+can use Ruby 2.x syntax and features.
## License
This software is licensed under the Apache 2 license, quoted below.