@@ -133,19 +133,38 @@ The details are explained below.
133
133
# Request builders
134
134
135
135
Some commonly used endpoints have high-level builder methods you can use to configure requests easily.
136
- They're exposed as methods on the `Client`:
136
+ They're exposed as methods on the `Client`.
137
+
138
+ ## Common requests
139
+
140
+ These request methods are called directly on a [`Client`][`Client`].
137
141
138
142
Client method | Elasticsearch API | Raw request type | Response type
139
143
------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------- | ------------------------------------
140
144
[`search`][Client.search] | [Search][docs-search] | [`SearchRequest`][SearchRequest] | [`SearchResponse`][SearchResponse]
141
145
[`bulk`][Client.bulk] | [Bulk][docs-bulk] | [`BulkRequest`][BulkRequest] | [`BulkResponse`][BulkResponse]
142
146
[`ping`][Client.ping] | - | [`PingRequest`][PingRequest] | [`PingResponse`][PingResponse]
147
+ [`sql`][Client.sql] | [SQL][docs-sql] | [`SqlQueryRequest`][SqlQueryRequest] | [`SqlQueryResponse`][SqlQueryResponse]
148
+
149
+ ## Document requests
150
+
151
+ These request methods are called on a [`DocumentClient`][`DocumentClient`].
152
+
153
+ Client method | Elasticsearch API | Raw request type | Response type
154
+ ------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------- | ------------------------------------
143
155
[`document.search`][Client.document.search] | [Search][docs-search] | [`SearchRequest`][SearchRequest] | [`SearchResponse`][SearchResponse]
144
156
[`document.get`][Client.document.get] | [Get Document][docs-get] | [`GetRequest`][GetRequest] | [`GetResponse`][GetResponse]
145
157
[`document.index`][Client.document.index] | [Index Document][docs-index] | [`IndexRequest`][IndexRequest] | [`IndexResponse`][IndexResponse]
146
158
[`document.update`][Client.document.update] | [Update Document][docs-update] | [`UpdateRequest`][UpdateRequest] | [`UpdateResponse`][UpdateResponse]
147
159
[`document.delete`][Client.document.delete] | [Delete Document][docs-delete] | [`DeleteRequest`][DeleteRequest] | [`DeleteResponse`][DeleteResponse]
148
160
[`document.put_mapping`][Client.document.put_mapping] | [Put Mapping][docs-mapping] | [`IndicesPutMappingRequest`][IndicesPutMappingRequest] | [`CommandResponse`][CommandResponse]
161
+
162
+ ## Index requests
163
+
164
+ These request methods are called on a [`IndexClient`][`IndexClient`].
165
+
166
+ Client method | Elasticsearch API | Raw request type | Response type
167
+ ------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------- | ------------------------------------
149
168
[`index.create`][Client.index.create] | [Create Index][docs-create-index] | [`IndicesCreateRequest`][IndicesCreateRequest] | [`CommandResponse`][CommandResponse]
150
169
[`index.open`][Client.index.open] | [Open Index][docs-open-index] | [`IndicesOpenRequest`][IndicesOpenRequest] | [`CommandResponse`][CommandResponse]
151
170
[`index.close`][Client.index.close] | [Close Index][docs-close-index] | [`IndicesCloseRequest`][IndicesCloseRequest] | [`CommandResponse`][CommandResponse]
@@ -217,7 +236,7 @@ The basic flow from request to response is:
217
236
[RawRequestBuilder.send()] ---> [ResponseBuilder]
218
237
```
219
238
220
- **3)** Parse the response builder to a [ response type][response-types] :
239
+ **3)** Parse the response builder to a response type:
221
240
222
241
```text
223
242
[ResponseBuilder.into_response()] ---> [ResponseType]
@@ -316,7 +335,7 @@ let response = request_builder.send();
316
335
317
336
### 3. Parsing responses synchronously
318
337
319
- Call [`SyncResponseBuilder.into_response`][SyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][response-types ]:
338
+ Call [`SyncResponseBuilder.into_response`][SyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][responses-mod ]:
320
339
321
340
```no_run
322
341
# #[macro_use] extern crate serde_json;
@@ -385,7 +404,7 @@ For more details see the [`responses`][responses-mod] module.
385
404
386
405
### 3. Parsing responses asynchronously
387
406
388
- Call [`AsyncResponseBuilder.into_response`][AsyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][response-types ]:
407
+ Call [`AsyncResponseBuilder.into_response`][AsyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][responses-mod ]:
389
408
390
409
```no_run
391
410
# #[macro_use] extern crate serde_json;
@@ -453,18 +472,19 @@ future.and_then(|body| {
453
472
`AsyncHttpResponse` implements the async `Stream` trait so you can buffer out the raw response data.
454
473
For more details see the [`responses`][responses-mod] module.
455
474
456
- [docs-bulk]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html
457
- [docs-search]: http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html
458
- [docs-get]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
459
- [docs-update]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html
460
- [docs-delete]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html
461
- [docs-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
462
- [docs-mapping]: https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html
463
- [docs-create-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html
464
- [docs-close-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
465
- [docs-open-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
466
- [docs-index-exists]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html
467
- [docs-delete-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html
475
+ [docs-bulk]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
476
+ [docs-search]: http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html
477
+ [docs-sql]: https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-spec.html
478
+ [docs-get]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html
479
+ [docs-update]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html
480
+ [docs-delete]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html
481
+ [docs-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html
482
+ [docs-mapping]: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html
483
+ [docs-create-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
484
+ [docs-close-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
485
+ [docs-open-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
486
+ [docs-index-exists]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html
487
+ [docs-delete-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html
468
488
469
489
[tokio]: https://tokio.rs
470
490
@@ -474,9 +494,13 @@ For more details see the [`responses`][responses-mod] module.
474
494
[SyncClientBuilder]: struct.SyncClientBuilder.html
475
495
[AsyncClient]: type.AsyncClient.html
476
496
[AsyncClientBuilder]: struct.AsyncClientBuilder.html
497
+ [`Client`]: struct.Client.html
498
+ [`DocumentClient`]: struct.DocumentClient.html
499
+ [`IndexClient`]: struct.IndexClient.html
477
500
[Client.request]: struct.Client.html#method.request
478
501
[Client.bulk]: struct.Client.html#bulk-request
479
502
[Client.search]: struct.Client.html#search-request
503
+ [Client.sql]: struct.Client.html#sql-request
480
504
[Client.document.search]: struct.DocumentClient.html#search-request
481
505
[Client.document.get]: struct.DocumentClient.html#get-document-request
482
506
[Client.document.update]: struct.DocumentClient.html#update-document-request
@@ -494,6 +518,7 @@ For more details see the [`responses`][responses-mod] module.
494
518
[RequestBuilder.params]: requests/struct.RequestBuilder.html#method.params
495
519
[RawRequestBuilder]: requests/type.RawRequestBuilder.html
496
520
[SearchRequest]: requests/endpoints/struct.SearchRequest.html
521
+ [SqlQueryRequest]: requests/endpoints/struct.SqlQueryRequest.html
497
522
[BulkRequest]: requests/endpoints/struct.BulkRequest.html
498
523
[GetRequest]: requests/endpoints/struct.GetRequest.html
499
524
[UpdateRequest]: requests/endpoints/struct.UpdateRequest.html
@@ -508,13 +533,14 @@ For more details see the [`responses`][responses-mod] module.
508
533
[PingRequest]: requests/endpoints/struct.PingRequest.html
509
534
510
535
[responses-mod]: responses/index.html
511
- [SyncResponseBuilder]: responses /struct.SyncResponseBuilder.html
512
- [SyncResponseBuilder.into_response]: responses /struct.SyncResponseBuilder.html#method.into_response
513
- [SyncResponseBuilder.into_raw]: responses /struct.SyncResponseBuilder.html#method.into_raw
514
- [AsyncResponseBuilder]: responses /struct.AsyncResponseBuilder.html
515
- [AsyncResponseBuilder.into_response]: responses /struct.AsyncResponseBuilder.html#method.into_response
516
- [AsyncResponseBuilder.into_raw]: responses /struct.AsyncResponseBuilder.html#method.into_raw
536
+ [SyncResponseBuilder]: ../http/receiver /struct.SyncResponseBuilder.html
537
+ [SyncResponseBuilder.into_response]: ../http/receiver /struct.SyncResponseBuilder.html#method.into_response
538
+ [SyncResponseBuilder.into_raw]: ../http/receiver /struct.SyncResponseBuilder.html#method.into_raw
539
+ [AsyncResponseBuilder]: ../http/receiver /struct.AsyncResponseBuilder.html
540
+ [AsyncResponseBuilder.into_response]: ../http/receiver /struct.AsyncResponseBuilder.html#method.into_response
541
+ [AsyncResponseBuilder.into_raw]: ../http/receiver /struct.AsyncResponseBuilder.html#method.into_raw
517
542
[SearchResponse]: responses/struct.SearchResponse.html
543
+ [SqlQueryResponse]: responses/struct.SqlQueryResponse.html
518
544
[BulkResponse]: responses/struct.BulkResponse.html
519
545
[GetResponse]: responses/struct.GetResponse.html
520
546
[UpdateResponse]: responses/struct.UpdateResponse.html
@@ -523,9 +549,8 @@ For more details see the [`responses`][responses-mod] module.
523
549
[IndicesExistsResponse]: responses/struct.IndicesExistsResponse.html
524
550
[PingResponse]: responses/struct.PingResponse.html
525
551
[CommandResponse]: responses/struct.CommandResponse.html
526
- [SyncHttpResponse]: responses/struct.SyncHttpResponse.html
527
- [AsyncHttpResponse]: responses/struct.AsyncHttpResponse.html
528
- [response-types]: responses/parse/trait.IsOk.html#implementors
552
+ [SyncHttpResponse]: ../http/receiver/struct.SyncHttpResponse.html
553
+ [AsyncHttpResponse]: ../http/receiver/struct.AsyncHttpResponse.html
529
554
530
555
[documents-mod]: ../types/documents/index.html
531
556
*/
0 commit comments