Struct rs_es::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
The core of the ElasticSearch client, owns a HTTP connection.
Each instance of Client
is reusable, but only one thread can use each one
at once. This will be enforced by the borrow-checker as most methods are
defined on &mut self
.
To create a Client
, the URL needs to be specified.
Each ElasticSearch API operation is defined as a method on Client
. Any
compulsory parameters must be given as arguments to this method. It returns
an operation builder that can be used to add any optional parameters.
Finally send
is called to submit the operation:
Examples
use rs_es::Client; let mut client = Client::new("http://localhost:9200");
See the specific operations and their builder objects for details.
Methods
impl Client
[src]
fn bulk<'a, 'b, S>(
&'a mut self,
actions: &'b [Action<S>]
) -> BulkOperation<'a, 'b, S> where
S: Serialize,
&'a mut self,
actions: &'b [Action<S>]
) -> BulkOperation<'a, 'b, S> where
S: Serialize,
impl Client
[src]
fn delete<'a>(
&'a mut self,
index: &'a str,
doc_type: &'a str,
id: &'a str
) -> DeleteOperation
&'a mut self,
index: &'a str,
doc_type: &'a str,
id: &'a str
) -> DeleteOperation
impl Client
[src]
fn delete_index<'a>(
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
Delete given index
TODO: ensure all options are supported, replace with a DeleteIndexOperation
to
follow the pattern defined elsewhere.
See: https://www.elastic.co/guide/en/elasticsearch/reference/2.x/indices-delete-index.html
impl Client
[src]
fn get<'a>(&'a mut self, index: &'a str, id: &'a str) -> GetOperation
Implementation of the ES GET API
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/docs-get.html
impl Client
[src]
fn index<'a, 'b, E: Serialize>(
&'a mut self,
index: &'b str,
doc_type: &'b str
) -> IndexOperation<'a, 'b, E>
&'a mut self,
index: &'b str,
doc_type: &'b str
) -> IndexOperation<'a, 'b, E>
An index operation to index a document in the specified index.
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/docs-index_.html
impl Client
[src]
fn refresh<'a>(&'a mut self) -> RefreshOperation
impl Client
[src]
fn count_uri<'a>(&'a mut self) -> CountURIOperation
Count via the query parameter
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-uri-request.html
fn count_query<'a>(&'a mut self) -> CountQueryOperation
Count via the query DSL
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-body.html
impl Client
[src]
fn search_uri<'a>(&'a mut self) -> SearchURIOperation
Search via the query parameter
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-uri-request.html
fn search_query<'a>(&'a mut self) -> SearchQueryOperation
Search via the query DSL
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-body.html
impl Client
[src]
fn analyze<'a>(&'a mut self, body: &'a str) -> AnalyzeOperation
impl Client
[src]
fn open_index<'a>(
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
Open the index, making it available.
fn close_index<'a>(
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
Close the index, making it unavailable and modifiable.
fn wait_for_status<'a>(
&'a mut self,
status: &'a str,
timeout: &'a str
) -> Result<(), EsError>
&'a mut self,
status: &'a str,
timeout: &'a str
) -> Result<(), EsError>
TODO: Return proper health data from https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html
impl Client
[src]
fn version(&mut self) -> VersionOperation
Calls the base ES path, returning the version number