meilisearch-sdk
MeiliSearch Rust is a client for MeiliSearch written in Rust. MeiliSearch is a powerful, fast, open-source, easy to use and deploy search engine. Both searching and indexing are highly customizable. Features such as typo-tolerance, filters, and synonyms are provided out-of-the-box.
Table of Contents
🔧 Installation
This crate requires a MeiliSearch server to run. See here to install and run MeiliSearch.
Then, put meilisearch-sdk = "0.1" in your Cargo.toml, as usual.
Using this crate is possible without serde, but a lot of features require serde.
Add serde = {version="1.0", features=["derive"]} in your Cargo.toml.
🚀 Getting Started
Here is a quickstart for a search request (please follow the installation steps before)
use ;
use ;
// That trait is required to make a struct usable by an index
// Create a client (without sending any request so that can't fail)
let client = new;
// Get the index called "books"
let mut books = client.get_or_create.unwrap;
// Add some books in the index
books.add_documents.unwrap;
// Query books (note that there is a typo)
let query = new;
println!;
Output:
🤖 Compatibility with MeiliSearch
This crate is currently supporting MeiliSearch v10.0 and will be maintained.
Running the tests
All the tests are documentation tests.
Since they are all making operations on the MeiliSearch server, running all the tests simultaneously would cause panics.
To run the tests one by one, run cargo test -- --test-threads=1.