|
1 |
| -# elasticsearch |
| 1 | +# elasticsearch   [![Latest Version]][crates.io] [![Docs]][docs.rs] [![Apache-2 licensed]][license] |
| 2 | + |
| 3 | +[Latest Version]: https://img.shields.io/crates/v/elasticsearch.svg |
| 4 | +[crates.io]: https://crates.io/crates/elasticsearch |
| 5 | +[Docs]: https://docs.rs/elasticsearch/badge.svg |
| 6 | +[docs.rs]: https://docs.rs/elasticsearch |
| 7 | +[Apache-2 licensed]: https://img.shields.io/crates/l/elasticsearch.svg |
| 8 | +[license]: ./LICENSE |
2 | 9 |
|
3 | 10 | Official Rust Client for [Elasticsearch](https://github.com/elastic/elasticsearch).
|
4 | 11 |
|
@@ -60,9 +67,10 @@ serde_json = "~1"
|
60 | 67 | ### Create a client
|
61 | 68 |
|
62 | 69 | Build a transport to make API requests to Elasticsearch using the `TransportBuilder`,
|
63 |
| -which allows setting of proxies and authentication schemes |
| 70 | +which allows setting of proxies, authentication schemes, certificate validation, and |
| 71 | +other transport related settings. |
64 | 72 |
|
65 |
| - To create a client to make API calls to Elasticsearch running on `http://localhost:9200` |
| 73 | +To create a client to make API calls to Elasticsearch running on `http://localhost:9200` |
66 | 74 |
|
67 | 75 | ```rust,no_run
|
68 | 76 | use elasticsearch::{Error, Elasticsearch};
|
@@ -100,16 +108,17 @@ use url::Url;
|
100 | 108 |
|
101 | 109 | fn run() -> Result<(), Error> {
|
102 | 110 | let cloud_id = "cluster_name:Y2xvdWQtZW5kcG9pbnQuZXhhbXBsZSQzZGFkZjgyM2YwNTM4ODQ5N2VhNjg0MjM2ZDkxOGExYQ==";
|
| 111 | + // can use other types of Credentials too, like Bearer or ApiKey |
103 | 112 | let credentials = Credentials::Basic("<username>".into(), "<password>".into());
|
104 | 113 | let transport = Transport::cloud(cloud_id, credentials)?;
|
105 | 114 | let client = Elasticsearch::new(transport);
|
106 | 115 | Ok(())
|
107 | 116 | }
|
108 | 117 | ```
|
109 | 118 |
|
110 |
| - More control over how a [Transport](http::transport::Transport) is built can be |
111 |
| - achieved using [TransportBuilder](http::transport::TransportBuilder) to build a transport, and |
112 |
| - passing it to [Elasticsearch::new] create a new instance of [Elasticsearch] |
| 119 | + More control over how a `Transport` is built can be |
| 120 | + achieved using `TransportBuilder` to build a transport, and |
| 121 | + passing it to `Elasticsearch::new()` create a new instance of `Elasticsearch` |
113 | 122 |
|
114 | 123 | ```rust,no_run
|
115 | 124 | use elasticsearch::{
|
|
0 commit comments