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
- 🚀 Getting Started
- 🌐 Running in the Browser with WASM
- 🤖 Compatibility with MeiliSearch
- ⚙️ Development Workflow and Contributing
🔧 Installation
To use meilisearch-sdk
, add this to your Cargo.toml
:
[]
= "0.3.0"
The following optional dependencies may also be useful:
= { = "0.2", = ["macros"] }
= { = "1.0", = ["derive"] }
Since this crate is async, you have to run your program in the tokio runtime. When targetting Wasm, the browser will replace tokio.
Using this crate is possible without serde, but a lot of features require serde.
Run a MeiliSearch Instance
This crate requires a MeiliSearch server to run.
There are many easy ways to download and run a MeiliSearch instance.
For example, if you use Docker:
NB: you can also download MeiliSearch from Homebrew or APT.
🚀 Getting Started
use ;
use ;
// That trait is required to make a struct usable by an index
async
Output:
[Book { book_id: 4, title: "Harry Potter and the Half-Blood Prince" }]
🌐 Running in the Browser with WASM
This crate fully supports WASM.
The only difference between the WASM and the native version is that the native version has one more variant (Error::Http
) in the Error enum. That should not matter so much but we could add this variant in WASM too.
However, making a program intended to run in a web browser requires a very different design than a CLI program. To see an example of a simple Rust web app using MeiliSearch, see the tutorial (not available yet).
WARNING: meilisearch-sdk
will panic if no Window is available (ex: Web extension).
🤖 Compatibility with MeiliSearch
This package is compatible with the following MeiliSearch versions:
v0.13.X
⚙️ Development Workflow and Contributing
Any new contribution is more than welcome in this project!
If you want to know more about the development workflow or want to contribute, please visit our contributing guidelines for detailed instructions!
MeiliSearch provides and maintains many SDKs and Integration tools like this one. We want to provide everyone with an amazing search experience for any kind of project. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the integration-guides repository.