Packages / rupm

rs-db-driver-elasticsearch-elasticsearch 0.1.0

Elasticsearch: elasticsearch (the driver, re-exported, with a runnable example)

Install

cargo add rs-db-driver-elasticsearch-elasticsearch --registry rupm

In Ruststudio: Packages, search for rs-db-driver-elasticsearch-elasticsearch, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.

Versions

README

# rs-db-driver-elasticsearch-elasticsearch

Elasticsearch - elasticsearch: the official async client

Add it with `rupm add rs-db-driver-elasticsearch-elasticsearch` (or `cargo add rs-db-driver-elasticsearch-elasticsearch --registry rupm`). The driver `elasticsearch` is re-exported as `rs_db_driver_elasticsearch_elasticsearch::elasticsearch`.

This driver is async: your project also needs an async runtime, for example `cargo add tokio --features macros,rt-multi-thread`.

## Example

```rust
use elasticsearch::http::transport::Transport;
use elasticsearch::Elasticsearch;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Elasticsearch::new(Transport::single_node("http://localhost:9200")?);
    let response = client.info().send().await?;
    let body = response.json::<serde_json::Value>().await?;
    println!("{body}");
    Ok(())
}
```