[−][src]Struct rs_es::Client
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::init("http://localhost:9200");
See the specific operations and their builder objects for details.
Methods
impl Client
[src]
pub fn analyze<'a>(&'a mut self, body: &'a str) -> AnalyzeOperation
[src]
Analyze
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html
impl Client
[src]
pub fn bulk<'a, 'b, S>(
&'a mut self,
actions: &'b [Action<S>]
) -> BulkOperation<'a, 'b, S> where
S: Serialize,
[src]
&'a mut self,
actions: &'b [Action<S>]
) -> BulkOperation<'a, 'b, S> where
S: Serialize,
Bulk
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
impl Client
[src]
pub fn delete<'a>(
&'a mut self,
index: &'a str,
doc_type: &'a str,
id: &'a str
) -> DeleteOperation
[src]
&'a mut self,
index: &'a str,
doc_type: &'a str,
id: &'a str
) -> DeleteOperation
Delete by ID
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/docs-delete.html
impl Client
[src]
pub fn delete_index<'a>(
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
[src]
&'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]
pub fn get<'a>(&'a mut self, index: &'a str, id: &'a str) -> GetOperation
[src]
Implementation of the ES GET API
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/docs-get.html
impl Client
[src]
pub fn index<'a, 'b, E: Serialize>(
&'a mut self,
index: &'b str,
doc_type: &'b str
) -> IndexOperation<'a, 'b, E>
[src]
&'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]
pub fn open_index<'a>(
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
[src]
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
Open the index, making it available.
pub fn close_index<'a>(
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
[src]
&'a mut self,
index: &'a str
) -> Result<GenericResult, EsError>
Close the index, making it unavailable and modifiable.
pub fn wait_for_status<'a>(
&'a mut self,
status: &'a str,
timeout: &'a str
) -> Result<(), EsError>
[src]
&'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]
pub fn refresh(&mut self) -> RefreshOperation
[src]
Refresh
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/indices-refresh.html
impl Client
[src]
pub fn count_uri(&mut self) -> CountURIOperation
[src]
Count via the query parameter
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-uri-request.html
pub fn count_query(&mut self) -> CountQueryOperation
[src]
Count via the query DSL
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-body.html
impl Client
[src]
pub fn search_uri(&mut self) -> SearchURIOperation
[src]
Search via the query parameter
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-uri-request.html
pub fn search_query(&mut self) -> SearchQueryOperation
[src]
Search via the query DSL
See: https://www.elastic.co/guide/en/elasticsearch/reference/1.x/search-request-body.html
impl Client
[src]
pub fn version(&mut self) -> VersionOperation
[src]
Calls the base ES path, returning the version number
impl Client
[src]
pub fn init(url_s: &str) -> Result<Client, UrlError>
[src]
Create a new client
pub fn init_with_timeout(
url_s: &str,
timeout: Option<Duration>
) -> Result<Client, UrlError>
[src]
url_s: &str,
timeout: Option<Duration>
) -> Result<Client, UrlError>
pub fn full_url(&self, suffix: &str) -> Url
[src]
Take a nearly complete ElasticSearch URL, and stick the URL on the front.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,