Strongly typed Elasticsearch DSL written in Rust

Overview

Strongly typed Elasticsearch DSL written in Rust

This is an unofficial library and doesn't yet support all the DSL, it's still work in progress.

Features

  • Strongly typed queries
  • Strongly typed aggregations
  • Automatically skips empty queries making DSL pleasant to use
  • Crate doesn't depend on elasticsearch-rs and can be used as a standalone library with any HTTP client to call Elasticsearch

Installation

Add elasticsearch-dsl crate and version to Cargo.toml

[dependencies]
elasticsearch-dsl = "0.1"

Documentation

Documentation for the library is available on docs.rs

Quick start

use elasticsearch_dsl::search::*;

let query = Search::new()
    .stats("statistics")
    .from(0u64)
    .size(30u64)
    .query(
        Query::bool()
            .must(Query::multi_match(
                ["title", "description"],
                "you know, for search",
            ))
            .filter(Query::terms("tags", ["elasticsearch"]))
            .should(Query::term("verified", true).boost(10)),
    );

See examples for more.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Comments
  • Add support for span queries

    Add support for span queries

    Adds support for Elasticsearch's span queries, https://www.elastic.co/guide/en/elasticsearch/reference/current/span-queries.html

    This PR is still a work-in-progress.

    Closes #100

    opened by jenrik 4
  • Remove unstable key-value attributes

    Remove unstable key-value attributes

    elasticsearch_dsl does not compile on stable Rust, which is a blocker for my company's use of this crate. It looks like the only unstable feature is this one, and it would only change one line of code: #![doc = include_str!("../README.md")]. Thoughts on removing this?

    opened by emmaling27 4
  • Specifying Index in search query

    Specifying Index in search query

    Hiya!

    Library looks fantastic!

    Was just wondering if there's some way to limit a query to a specific index? Similar to how the elastic-search rs library accepts an index-id:

    es_client.search(SearchParts::Index(&[&index_id]))
                   .from(0)
                   // etc etc
    
    opened by tom-w-tdy-ansarda 1
  • Awesome!

    Awesome!

    This looks really cool. I just wanted to offer my encouragement as the author of https://github.com/bitemyapp/bloodhound

    I'm very grateful this exists, I may need it at some point :)

    opened by bitemyapp 1
  • Bump to 0.4

    Bump to 0.4

    A large release with lots of cleanup:

    • Relaxed query construction, terms queries now accept anything that's serializable, this won't require creating custom From For Term conversions
    • Support for all types of sorting criteria
    • Support for completions
    • Improved search responses with delayed parsing
    • Correct inner hits support
    • And much more.
    opened by buinauskas 0
  • Simplify boost type

    Simplify boost type

    A dedicated boost type was an overkill, it did data validation, which is probably not what this library is about, all it should do is query construction.

    opened by buinauskas 0
  • Refactor Geo Location type

    Refactor Geo Location type

    There have been multiple types: GeoPoint, GeoCoordinates and they kinda represented the same thing, this will use only a single GeoLocation type for query dsl.

    opened by buinauskas 0
Owner
null
🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.

?? Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.

Valerian Saliou 17.4k Jan 2, 2023
Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust

Tantivy is a full text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

tantivy 7.4k Dec 28, 2022
A full-text search and indexing server written in Rust.

Bayard Bayard is a full-text search and indexing server written in Rust built on top of Tantivy that implements Raft Consensus Algorithm and gRPC. Ach

Bayard Search 1.8k Dec 26, 2022
Message authentication code algorithms written in pure Rust

RustCrypto: Message Authentication Codes Collection of Message Authentication Code (MAC) algorithms written in pure Rust. Supported Algorithms Algorit

Rust Crypto 155 Dec 31, 2022
Shogun search - Learning the principle of search engine. This is the first time I've written Rust.

shogun_search Learning the principle of search engine. This is the first time I've written Rust. A search engine written in Rust. Current Features: Bu

Yuxiang Liu 5 Mar 9, 2022
Tantivy is a full text search engine library written in Rust.

Tantivy is a full text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

Quickwit OSS 7.4k Dec 30, 2022
Tantivy is a full-text search engine library inspired by Apache Lucene and written in Rust

Tantivy is a full-text search engine library written in Rust. It is closer to Apache Lucene than to Elasticsearch or Apache Solr in the sense it is no

Quickwit OSS 7.5k Jan 9, 2023
AI-powered search engine for Rust

txtai: AI-powered search engine for Rust txtai executes machine-learning workflows to transform data and build AI-powered text indices to perform simi

NeuML 69 Jan 2, 2023
A full-text search engine in rust

Toshi A Full-Text Search Engine in Rust Please note that this is far from production ready, also Toshi is still under active development, I'm just slo

Toshi Search 3.8k Jan 7, 2023
🐎 Daac Horse: Double-Array Aho-Corasick in Rust

?? daachorse Daac Horse: Double-Array Aho-Corasick Overview A fast implementation of the Aho-Corasick algorithm using Double-Array Trie. Examples use

null 140 Dec 16, 2022
Searching for plain-text files for lines that match a given string. Built with Rust.

Getting Started This is a minimal grep command-line utility built on Rust. It provides searching for plain-text files for lines that match a given str

Harsh Karande 0 Dec 31, 2021
A Rust API search engine

Roogle Roogle is a Rust API search engine, which allows you to search functions by names and type signatures. Progress Available Queries Function quer

Roogle 342 Dec 26, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Experimenting with Rust implementations of IP address lookup algorithms.

This repository contains some very rough experimentation with Rust implementations of IP address lookup algorithms, both my own and comparison with th

Ximon Eighteen 0 Jan 10, 2022
An example of web application by using Rust and Axum with Clean Architecture.

stock-metrics Stock price and stats viewer. Getting Started Middleware Launch the middleware by executing docker compose: cd local-middleware docker c

Yuki Toyoda 62 Dec 10, 2022
2 and 3-dimensional collision detection library in Rust.

2D Documentation | 3D Documentation | User Guide | Forum ⚠️ **This crate is now passively-maintained. It is being superseded by the Parry project.** ⚠

dimforge 914 Dec 24, 2022
Image search example by approximate nearest-neighbor library In Rust

rust-ann-search-example Image search example by approximate nearest-neighbor library In Rust use - tensorflow 0.17.0 - pretrain ResNet50 - hora (Ru

vaaaaanquish 8 Jan 3, 2022
Simplified Find command made with Rust.

Hunt Hunt is a (highly-opinionated) simplified Find command made with Rust. It searches a file/folder by name on the entire drive. If the --first flag

LyonSyonII 65 Jan 4, 2023
ik-analyzer for rust; chinese tokenizer for tantivy

ik-rs ik-analyzer for Rust support Tantivy Usage Chinese Segment let mut ik = IKSegmenter::new(); let text = "中华人民共和国"; let tokens = ik.to

Shen Yanchao 4 Dec 26, 2022