Skip to content

prepare for 0.21.0-pre.5 release #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Add `elastic` to your `Cargo.toml`:

```toml
[dependencies]
elastic = "0.21.0-pre.4"
elastic_derive = "0.21.0-pre.4"
elastic = "0.21.0-pre.5"
elastic_derive = "0.21.0-pre.5"
serde_json = "1"
```

Expand Down
4 changes: 2 additions & 2 deletions examples/account_sample/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ authors = ["Ashley Mannix <[email protected]>"]
publish = false

[dependencies]
elastic = { version = "~0.21.0-pre.4", path = "../../src/elastic" }
elastic_derive = { version = "~0.21.0-pre.4", path = "../../src/elastic_derive" }
elastic = { version = "~0.21.0-pre.5", path = "../../src/elastic" }
elastic_derive = { version = "~0.21.0-pre.5", path = "../../src/elastic_derive" }

quick-error = "~1"
serde = "~1"
Expand Down
15 changes: 12 additions & 3 deletions src/elastic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elastic"
version = "0.21.0-pre.4"
version = "0.21.0-pre.5"
edition = "2018"
authors = ["Ashley Mannix <[email protected]>"]
license = "MIT/Apache-2.0"
Expand All @@ -14,8 +14,17 @@ readme = "../../README.md"
travis-ci = { repository = "elastic-rs/elastic" }
appveyor = { repository = "elastic-rs/elastic" }

[features]
rustls-tls = [
"reqwest/rustls-tls"
]

default-tls = [
"reqwest/default-tls"
]

[dependencies]
elastic_derive = { version = "~0.21.0-pre.4", path = "../elastic_derive" }
elastic_derive = { version = "~0.21.0-pre.5", path = "../elastic_derive" }

quick-error = "~1"
error-chain = "~0.11"
Expand All @@ -27,7 +36,7 @@ http = "~0.1"
serde = "~1"
serde_json = "~1"
serde_derive = "~1"
reqwest = { version = "~0.9", default-features = false, features = ["rustls-tls"]}
reqwest = { version = "~0.9", default-features = false }
futures = "~0.1"
tokio = "~0.1"
tokio-threadpool = "~0.1"
Expand Down
75 changes: 50 additions & 25 deletions src/elastic/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,38 @@ The details are explained below.
# Request builders

Some commonly used endpoints have high-level builder methods you can use to configure requests easily.
They're exposed as methods on the `Client`:
They're exposed as methods on the `Client`.

## Common requests

These request methods are called directly on a [`Client`][`Client`].

Client method | Elasticsearch API | Raw request type | Response type
------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------- | ------------------------------------
[`search`][Client.search] | [Search][docs-search] | [`SearchRequest`][SearchRequest] | [`SearchResponse`][SearchResponse]
[`bulk`][Client.bulk] | [Bulk][docs-bulk] | [`BulkRequest`][BulkRequest] | [`BulkResponse`][BulkResponse]
[`ping`][Client.ping] | - | [`PingRequest`][PingRequest] | [`PingResponse`][PingResponse]
[`sql`][Client.sql] | [SQL][docs-sql] | [`SqlQueryRequest`][SqlQueryRequest] | [`SqlQueryResponse`][SqlQueryResponse]

## Document requests

These request methods are called on a [`DocumentClient`][`DocumentClient`].

Client method | Elasticsearch API | Raw request type | Response type
------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------- | ------------------------------------
[`document.search`][Client.document.search] | [Search][docs-search] | [`SearchRequest`][SearchRequest] | [`SearchResponse`][SearchResponse]
[`document.get`][Client.document.get] | [Get Document][docs-get] | [`GetRequest`][GetRequest] | [`GetResponse`][GetResponse]
[`document.index`][Client.document.index] | [Index Document][docs-index] | [`IndexRequest`][IndexRequest] | [`IndexResponse`][IndexResponse]
[`document.update`][Client.document.update] | [Update Document][docs-update] | [`UpdateRequest`][UpdateRequest] | [`UpdateResponse`][UpdateResponse]
[`document.delete`][Client.document.delete] | [Delete Document][docs-delete] | [`DeleteRequest`][DeleteRequest] | [`DeleteResponse`][DeleteResponse]
[`document.put_mapping`][Client.document.put_mapping] | [Put Mapping][docs-mapping] | [`IndicesPutMappingRequest`][IndicesPutMappingRequest] | [`CommandResponse`][CommandResponse]

## Index requests

These request methods are called on a [`IndexClient`][`IndexClient`].

Client method | Elasticsearch API | Raw request type | Response type
------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------- | ------------------------------------
[`index.create`][Client.index.create] | [Create Index][docs-create-index] | [`IndicesCreateRequest`][IndicesCreateRequest] | [`CommandResponse`][CommandResponse]
[`index.open`][Client.index.open] | [Open Index][docs-open-index] | [`IndicesOpenRequest`][IndicesOpenRequest] | [`CommandResponse`][CommandResponse]
[`index.close`][Client.index.close] | [Close Index][docs-close-index] | [`IndicesCloseRequest`][IndicesCloseRequest] | [`CommandResponse`][CommandResponse]
Expand Down Expand Up @@ -217,7 +236,7 @@ The basic flow from request to response is:
[RawRequestBuilder.send()] ---> [ResponseBuilder]
```

**3)** Parse the response builder to a [response type][response-types]:
**3)** Parse the response builder to a response type:

```text
[ResponseBuilder.into_response()] ---> [ResponseType]
Expand Down Expand Up @@ -316,7 +335,7 @@ let response = request_builder.send();

### 3. Parsing responses synchronously

Call [`SyncResponseBuilder.into_response`][SyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][response-types]:
Call [`SyncResponseBuilder.into_response`][SyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][responses-mod]:

```no_run
# #[macro_use] extern crate serde_json;
Expand Down Expand Up @@ -385,7 +404,7 @@ For more details see the [`responses`][responses-mod] module.

### 3. Parsing responses asynchronously

Call [`AsyncResponseBuilder.into_response`][AsyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][response-types]:
Call [`AsyncResponseBuilder.into_response`][AsyncResponseBuilder.into_response] on a sent request to get a [strongly typed response][responses-mod]:

```no_run
# #[macro_use] extern crate serde_json;
Expand Down Expand Up @@ -453,18 +472,19 @@ future.and_then(|body| {
`AsyncHttpResponse` implements the async `Stream` trait so you can buffer out the raw response data.
For more details see the [`responses`][responses-mod] module.

[docs-bulk]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html
[docs-search]: http://www.elastic.co/guide/en/elasticsearch/reference/master/search-search.html
[docs-get]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
[docs-update]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update.html
[docs-delete]: http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html
[docs-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html
[docs-mapping]: https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html
[docs-create-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html
[docs-close-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
[docs-open-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html
[docs-index-exists]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html
[docs-delete-index]: https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html
[docs-bulk]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
[docs-search]: http://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html
[docs-sql]: https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-spec.html
[docs-get]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html
[docs-update]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html
[docs-delete]: http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html
[docs-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html
[docs-mapping]: https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html
[docs-create-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
[docs-close-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
[docs-open-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html
[docs-index-exists]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html
[docs-delete-index]: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html

[tokio]: https://tokio.rs

Expand All @@ -474,9 +494,13 @@ For more details see the [`responses`][responses-mod] module.
[SyncClientBuilder]: struct.SyncClientBuilder.html
[AsyncClient]: type.AsyncClient.html
[AsyncClientBuilder]: struct.AsyncClientBuilder.html
[`Client`]: struct.Client.html
[`DocumentClient`]: struct.DocumentClient.html
[`IndexClient`]: struct.IndexClient.html
[Client.request]: struct.Client.html#method.request
[Client.bulk]: struct.Client.html#bulk-request
[Client.search]: struct.Client.html#search-request
[Client.sql]: struct.Client.html#sql-request
[Client.document.search]: struct.DocumentClient.html#search-request
[Client.document.get]: struct.DocumentClient.html#get-document-request
[Client.document.update]: struct.DocumentClient.html#update-document-request
Expand All @@ -494,6 +518,7 @@ For more details see the [`responses`][responses-mod] module.
[RequestBuilder.params]: requests/struct.RequestBuilder.html#method.params
[RawRequestBuilder]: requests/type.RawRequestBuilder.html
[SearchRequest]: requests/endpoints/struct.SearchRequest.html
[SqlQueryRequest]: requests/endpoints/struct.SqlQueryRequest.html
[BulkRequest]: requests/endpoints/struct.BulkRequest.html
[GetRequest]: requests/endpoints/struct.GetRequest.html
[UpdateRequest]: requests/endpoints/struct.UpdateRequest.html
Expand All @@ -508,13 +533,14 @@ For more details see the [`responses`][responses-mod] module.
[PingRequest]: requests/endpoints/struct.PingRequest.html

[responses-mod]: responses/index.html
[SyncResponseBuilder]: responses/struct.SyncResponseBuilder.html
[SyncResponseBuilder.into_response]: responses/struct.SyncResponseBuilder.html#method.into_response
[SyncResponseBuilder.into_raw]: responses/struct.SyncResponseBuilder.html#method.into_raw
[AsyncResponseBuilder]: responses/struct.AsyncResponseBuilder.html
[AsyncResponseBuilder.into_response]: responses/struct.AsyncResponseBuilder.html#method.into_response
[AsyncResponseBuilder.into_raw]: responses/struct.AsyncResponseBuilder.html#method.into_raw
[SyncResponseBuilder]: ../http/receiver/struct.SyncResponseBuilder.html
[SyncResponseBuilder.into_response]: ../http/receiver/struct.SyncResponseBuilder.html#method.into_response
[SyncResponseBuilder.into_raw]: ../http/receiver/struct.SyncResponseBuilder.html#method.into_raw
[AsyncResponseBuilder]: ../http/receiver/struct.AsyncResponseBuilder.html
[AsyncResponseBuilder.into_response]: ../http/receiver/struct.AsyncResponseBuilder.html#method.into_response
[AsyncResponseBuilder.into_raw]: ../http/receiver/struct.AsyncResponseBuilder.html#method.into_raw
[SearchResponse]: responses/struct.SearchResponse.html
[SqlQueryResponse]: responses/struct.SqlQueryResponse.html
[BulkResponse]: responses/struct.BulkResponse.html
[GetResponse]: responses/struct.GetResponse.html
[UpdateResponse]: responses/struct.UpdateResponse.html
Expand All @@ -523,9 +549,8 @@ For more details see the [`responses`][responses-mod] module.
[IndicesExistsResponse]: responses/struct.IndicesExistsResponse.html
[PingResponse]: responses/struct.PingResponse.html
[CommandResponse]: responses/struct.CommandResponse.html
[SyncHttpResponse]: responses/struct.SyncHttpResponse.html
[AsyncHttpResponse]: responses/struct.AsyncHttpResponse.html
[response-types]: responses/parse/trait.IsOk.html#implementors
[SyncHttpResponse]: ../http/receiver/struct.SyncHttpResponse.html
[AsyncHttpResponse]: ../http/receiver/struct.AsyncHttpResponse.html

[documents-mod]: ../types/documents/index.html
*/
Expand Down
8 changes: 4 additions & 4 deletions src/elastic/src/client/requests/bulk/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
Builders for [bulk requests][docs-bulk].

[docs-bulk]: https://www.elastic.co/guide/en/elasticsearch/reference/master/bulk.html
[docs-bulk]: https://www.elastic.co/guide/en/elasticsearch/reference/current/bulk.html
*/

use std::{
Expand Down Expand Up @@ -63,7 +63,7 @@ The `send` method will either send the request [synchronously][send-sync] or [as

Call [`Client.bulk_stream`][Client.bulk_stream] to get a `BulkRequestBuilder` that can be used to stream bulk operations asynchronously.

[docs-bulk]: https://www.elastic.co/guide/en/elasticsearch/reference/master/bulk.html
[docs-bulk]: https://www.elastic.co/guide/en/elasticsearch/reference/current/bulk.html
[send-sync]: #send-synchronously
[send-async]: #send-asynchronously
[Client.bulk]: ../../struct.Client.html#bulk-request
Expand Down Expand Up @@ -150,7 +150,7 @@ where
[send-async]: requests/bulk/type.BulkRequestBuilder.html#send-asynchronously
[types-mod]: ../../types/index.html
[documents-mod]: ../../types/document/index.html
[docs-querystring]: https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-query-string-query.html
[docs-querystring]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
*/
pub fn bulk(&self) -> BulkRequestBuilder<TSender, Vec<u8>, BulkResponse> {
RequestBuilder::initial(
Expand Down Expand Up @@ -238,7 +238,7 @@ impl Client<AsyncSender> {
[send-async]: requests/bulk/type.BulkRequestBuilder.html#send-asynchronously
[types-mod]: ../../types/index.html
[documents-mod]: ../../types/document/index.html
[docs-querystring]: https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-query-string-query.html
[docs-querystring]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html
*/
pub fn bulk_stream<TDocument>(
&self,
Expand Down
Loading