All Projects → elastic-rs → Elastic

elastic-rs / Elastic

Licence: other
An Elasticsearch REST API client for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Elastic

Spring Cloud Microservices Development
Spring Cloud Microservices Development.《Spring Cloud 微服务架构开发实战》
Stars: ✭ 106 (-57.26%)
Mutual labels:  elasticsearch, http-client
Typo3 Docker Boilerplate
🍲 TYPO3 Docker Boilerplate project (NGINX, Apache HTTPd, PHP-FPM, MySQL, Solr, Elasticsearch, Redis, FTP)
Stars: ✭ 240 (-3.23%)
Mutual labels:  elasticsearch
Elastic
R client for the Elasticsearch HTTP API
Stars: ✭ 227 (-8.47%)
Mutual labels:  elasticsearch
Avhttp
avhttp is concurrent http downloader
Stars: ✭ 232 (-6.45%)
Mutual labels:  http-client
Archivy
Archivy is a self-hosted knowledge repository that allows you to safely preserve useful content that contributes to your own personal, searchable and extendable wiki.
Stars: ✭ 2,746 (+1007.26%)
Mutual labels:  elasticsearch
Eland
Python Client and Toolkit for DataFrames, Big Data, Machine Learning and ETL in Elasticsearch
Stars: ✭ 235 (-5.24%)
Mutual labels:  elasticsearch
Userline
Query and report user logons relations from MS Windows Security Events
Stars: ✭ 221 (-10.89%)
Mutual labels:  elasticsearch
Eui
Elastic UI Framework 🙌
Stars: ✭ 3,248 (+1209.68%)
Mutual labels:  elasticsearch
Neo4j To Elasticsearch
GraphAware Framework Module for Integrating Neo4j with Elasticsearch
Stars: ✭ 241 (-2.82%)
Mutual labels:  elasticsearch
Relevant Search Book
Code and Examples for Relevant Search
Stars: ✭ 231 (-6.85%)
Mutual labels:  elasticsearch
Elastix
A simple Elasticsearch REST client written in Elixir.
Stars: ✭ 231 (-6.85%)
Mutual labels:  elasticsearch
Springboot Learning Example
spring boot 实践学习案例,是 spring boot 初学者及核心技术巩固的最佳实践。
Stars: ✭ 14,640 (+5803.23%)
Mutual labels:  elasticsearch
Esbulk
Bulk indexing command line tool for elasticsearch
Stars: ✭ 235 (-5.24%)
Mutual labels:  elasticsearch
Webporter
基于 webmagic 的 Java 爬虫应用
Stars: ✭ 2,598 (+947.58%)
Mutual labels:  elasticsearch
Retail Demo Store
AWS Retail Demo Store is a sample retail web application and workshop platform demonstrating how AWS infrastructure and services can be used to build compelling customer experiences for eCommerce, retail, and digital marketing use-cases
Stars: ✭ 238 (-4.03%)
Mutual labels:  elasticsearch
Docker Elasticsearch Kubernetes
Ready to use Elasticsearch + Kubernetes discovery plug-in Docker image.
Stars: ✭ 227 (-8.47%)
Mutual labels:  elasticsearch
Http Client
[Deprecated] Event-driven, streaming HTTP client for ReactPHP.
Stars: ✭ 228 (-8.06%)
Mutual labels:  http-client
Punchclock
Make sure your asynchronous operations show up to work on time
Stars: ✭ 235 (-5.24%)
Mutual labels:  http-client
Elasticsearch Analysis Stconvert
STConvert is analyzer that convert chinese characters between traditional and simplified.中文简繁體互相转换.
Stars: ✭ 247 (-0.4%)
Mutual labels:  elasticsearch
Sist2
Lightning-fast file system indexer and search tool
Stars: ✭ 245 (-1.21%)
Mutual labels:  elasticsearch

elastic Latest Version Gitter

elastic is an efficient, modular API client for Elasticsearch written in Rust. The API is targeting the Elastic Stack 7.x.

elastic provides strongly-typed documents and weakly-typed queries.

Quick reference:

Also check out the official elasticsearch crate!

Stability

This crate is still quite unstable and is likely to continue to churn breaking releases over the near future with not-so-detailed changelogs.

If you run into any problems upgrading in your own open source projects feel free to open up an issue and we'll give you a hand. The goal is definitely to offer a stable API eventually.

Build Status

Platform Channel Status (master)
Linux / macOS Stable/Nightly Build Status
Windows Nightly Build status

Documentation

Version Docs
current (master) Documentation

Example

Add elastic to your Cargo.toml:

[dependencies]
elastic = "0.21.0-pre.5"
elastic_derive = "0.21.0-pre.5"
serde_json = "1"

Create a SyncClient and start making requests:

#[macro_use]
extern crate elastic_derive;
#[macro_use]
extern crate serde_json;
extern crate elastic;

use serde_json::Value;
use elastic::prelude::*;

// A reqwest HTTP client and default parameters.
// The builder includes the base node url (http://localhost:9200).
let client = SyncClient::builder().build()?;

let query = "some query string";

// A search request with a freeform body.
let res = client.search::<Value>()
                .index("_all")
                .body(json!({
                    "query": {
                        "query_string": {
                            "query": query
                        }
                    }
                }))
                .send()?;

// Iterate through the hits in the response.
for hit in res.hits() {
    println!("{:?}", hit);
}

elastic also offers an AsyncClient for use with the tokio asynchronous io stack. See the examples folder for complete samples.

Building documents

Document mapping is derived at compile-time from your Plain Old Rust Structures. Just add a #[derive(ElasticType)] attribute:

#[derive(ElasticType, Serialize, Deserialize)]
struct MyDocument {
	#[elastic(id)]
	pub id: String,
	pub title: String,
	pub timestamp: Date<DefaultDateMapping<EpochMillis>>,
	pub content: Text<DefaultTextMapping>,
}

And you can start using MyDocument in Client request methods.

See the docs for more details.

Alternatives

elastic.co released an official client, elasticsearch. Although it is still in an alpha stage (as of 2020-02-10), it is very comprehensive and generates most of its code from the official REST API specifications.

Additionally, if you'd like to use a strongly-typed Query DSL builder see rs-es. This client does the hard work of providing an idiomatic Rust API for interacting with Elasticsearch. It has the advantage of letting you know your queries will parse at compile-time instead of runtime.

Goals

To provide a full-featured and efficient Elasticsearch client for Rust over asynchronous io. Rust gives us a lot of tools for building super-performant but highly accessible libraries, which we aim to continue. elastic is aimed at people who need to work with Elasticsearch and are considering using Rust, as well as users that are already using Rust. We want to offer a solution to interacting with Elasticsearch that's compelling from both within and outside the Rust ecosystem.

The REST API is covered by a simple inline JSON macro like serde_json's json! so it's always possible to build any query. This means you don't need to learn another API for interacting with Elasticsearch; queries mocked in Dev Tools could just be copy+pasted into your Rust source.

The core focus of this project is on strong typing over your document types and query responses in Elasticsearch, rather than trying to map the entire Query DSL.

Support for Elastic's plugin products, like watcher and graph could be added as feature-gated modules as necessary.

License

Licensed under either of these:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].