1
1
//! Official Rust client for [Elasticsearch](https://www.elastic.co/products/elasticsearch)
2
2
//!
3
- //! `Elasticsearch` is the Official Rust client for Elasticsearch, providing an efficient and easy
4
- //! to use asynchronous client for all stable Elasticsearch APIs.
3
+ //! `Elasticsearch` is an official Rust client for Elasticsearch, providing an efficient asynchronous
4
+ //! client for all stable Elasticsearch APIs that's easy to use .
5
5
//!
6
6
//! # Versions and Compatibility
7
7
//!
25
25
//! Elasticsearch 7.5.0+, but for all other APIs available in Elasticsearch, the respective API
26
26
//! functions on the client will be compatible.
27
27
//!
28
- //! **No compatibility assurances are given** between different major versions of the client and
29
- //! Elasticsearch. Major differences likely exist between major versions of Elasticsearch, particularly
28
+ //! **No compatibility assurances are given between different major versions of the client and
29
+ //! Elasticsearch** . Major differences likely exist between major versions of Elasticsearch, particularly
30
30
//! around request and response object formats, but also around API urls and behaviour.
31
31
//!
32
32
//! # Getting started
33
33
//!
34
- //! Add the crate name and version to Cargo.toml. Choose the version that is compatible with
34
+ //! Add the `elasticsearch` crate and version to Cargo.toml. Choose the version that is compatible with
35
35
//! the version of Elasticsearch you're using
36
36
//!
37
37
//! ```toml,no_run
57
57
//! # Ok(())
58
58
//! # }
59
59
//! ```
60
- //! You can create a client to make API calls against Elasticsearch running on a
60
+ //! Alternatively, you can create a client to make API calls against Elasticsearch running on a
61
61
//! specific [url::Url]
62
62
//!
63
63
//! ```rust,no_run
92
92
//! # }
93
93
//! ```
94
94
//!
95
- //! More control over how a [Transport](http::transport::Transport) is configured can be
96
- //! achieved using [TransportBuilder](http::transport::TransportBuilder) to build a transport and
97
- //! passing it to create a new instance of [Elasticsearch]
95
+ //! More control over how a [Transport](http::transport::Transport) is built can be
96
+ //! achieved using [TransportBuilder](http::transport::TransportBuilder) to build a transport, and
97
+ //! passing it to [Elasticsearch::new] create a new instance of [Elasticsearch]
98
98
//!
99
99
//! ```rust,no_run
100
100
//! # use elasticsearch;
115
115
//! ## Making API calls
116
116
//!
117
117
//! The client exposes all stable Elasticsearch APIs, either on the root [Elasticsearch] client,
118
- //! or on a _namespace_ client such as [Cat](cat::Cat), that groups related APIs. All API functions
119
- //! are `async` and can be `await`ed
118
+ //! or on a _namespace_ client that groups related APIs, such as [Cat](cat::Cat), which groups the
119
+ //! Cat related APIs. All API functions are `async` and can be `await`ed.
120
+ //!
121
+ //! The following makes an API call to `tweets/_search` with the json body
122
+ //! `{"query":{"match":{"message":"Elasticsearch"}}}`
120
123
//!
121
124
//! ```rust,no_run
122
125
//! # use elasticsearch;
145
148
//! # Ok(())
146
149
//! # }
147
150
//! ```
148
- //!
151
+ //! For APIs that contain parts of the Url path to be provided by the consumer, the Url path
152
+ //! variants are modelled as an `enum`, such as [SearchParts] in the above example, which models
153
+ //! the variants of the [Search] API.
149
154
//!
150
155
151
156
// also test examples in README
@@ -177,6 +182,7 @@ pub mod license;
177
182
pub mod migration;
178
183
pub mod ml;
179
184
pub mod nodes;
185
+ pub mod params;
180
186
pub mod security;
181
187
pub mod slm;
182
188
pub mod snapshot;
@@ -192,7 +198,7 @@ mod generated;
192
198
193
199
// exposes types within modules at the library root level
194
200
pub use crate :: {
195
- client:: * , error:: * , generated:: params , generated :: root:: * ,
201
+ client:: * , error:: * , generated:: root:: * ,
196
202
http:: transport:: DEFAULT_ADDRESS ,
197
203
} ;
198
204
0 commit comments