An efficient, modular Elasticsearch REST API client for Rust with strongly-typed documents and weakly-typed queries.
elastic is a Rust client library for interacting with Elasticsearch, targeting the Elastic Stack 7.x. It provides a strongly-typed, efficient, and modular API for integrating Elasticsearch into Rust applications, focusing on compile-time document mapping and flexible query construction.
Rust developers building applications that require integration with Elasticsearch, particularly those who value type safety for documents and need both synchronous and asynchronous client options.
Developers choose elastic for its strong typing over document types and query responses, derived from Rust structs at compile-time, combined with the flexibility of weakly-typed queries using a familiar JSON macro. It offers a full-featured API with both sync and async clients, prioritizing performance and accessibility.
An Elasticsearch REST API client for Rust
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Document mapping is derived at compile-time from Rust structs using #[derive(ElasticType)], ensuring type safety and reducing runtime errors for data structures.
Queries are built with an inline JSON macro, similar to Elasticsearch's Dev Tools, allowing easy copy-pasting and familiar query construction without learning a new API.
Offers both SyncClient for synchronous operations and AsyncClient for use with tokio, providing flexibility for different application architectures and I/O needs.
Built with efficiency in mind, leveraging Rust's capabilities to deliver a high-performance and modular API suitable for demanding applications.
The README explicitly states the crate is 'still quite unstable' with frequent breaking releases and not-so-detailed changelogs, making upgrades challenging for production.
Queries are not strongly typed, so errors in query construction might only be caught at runtime, unlike alternatives like rs-es that offer compile-time query validation.
Targets only Elastic Stack 7.x, which may not be compatible with newer or older Elasticsearch versions without updates, restricting its use in evolving environments.