Type Definition elastic::client::requests::index_create::IndexCreateRequestBuilder [] [src]

type IndexCreateRequestBuilder<TSender, TBody> = RequestBuilder<TSender, IndexCreateRequestInner<TBody>>;

A create index request builder that can be configured before sending.

Call Client.index_create to get an IndexCreateRequestBuilder. The send method will either send the request synchronously or asynchronously, depending on the Client it was created from.

Methods

impl<TSender, TBody> IndexCreateRequestBuilder<TSender, TBody> where
    TSender: Sender,
    TBody: Into<TSender::Body>, 
[src]

Builder methods

Configure an IndexCreateRequestBuilder before sending it.

[src]

Set the body for the create index request.

If no body is specified then an empty query will be used.

impl<TBody> IndexCreateRequestBuilder<SyncSender, TBody> where
    TBody: Into<<SyncSender as Sender>::Body>, 
[src]

[src]

Send an IndexCreateRequestBuilder synchronously using a SyncClient.

This will block the current thread until a response arrives and is deserialised.

Examples

Create an index called myindex:

let response = client.index_create(index("myindex")).send()?;

assert!(response.acknowledged());

impl<TBody> IndexCreateRequestBuilder<AsyncSender, TBody> where
    TBody: Into<<AsyncSender as Sender>::Body>, 
[src]

[src]

Send an IndexCreateRequestBuilder asynchronously using an AsyncClient.

This will return a future that will resolve to the deserialised command response.

Examples

Create an index called myindex:

let future = client.index_create(index("myindex")).send();

future.and_then(|response| {
    assert!(response.acknowledged());

    Ok(())
});