elastic_hyper 
Provides a synchronous hyper implementation of the Elasticsearch REST API. The hyper client is simple to use; there's basically no setup needed besides creating a hyper::Client object to use for requests. The hyper client is general-purpose, and suitable for any scenario where on-demand requests are sufficient.
If you'd prefer to call Elasticsearch using a strongly-typed Query DSL builder, see rs-es.
Build Status
| Platform | Channel | Status |
|---|---|---|
| Linux / OSX | Stable / Nightly | |
| Windows | Nightly |
Documentation
| Version | Docs |
|---|---|
master |
|
current |
Example
The elastic_hyper client is a thin layer over hyper; it just maps functions to routes. It's up to the caller to serialise and deserialise HTTP content.
- For query serialisation, the
json_strcrate provides thejson_str!macro for creating ad-hoc API queries. - For type serialisation / deserialisation, see
elastic_types.
Currently targeting the master Elasticsearch branch, aiming for 5.x.
This will be stabilised through features in the future.
Add elastic_hyper and json_str to your Cargo.toml:
[dependencies]
elastic_hyper = "*"
json_str = "*"
Ping the availability of your cluster:
extern crate json_str;
extern crate elastic_hyper as elastic;
let = default;
head.unwrap;
A simple query_string query:
extern crate json_str;
extern crate elastic_hyper as elastic;
let = default;
let response = post.unwrap;