meilisearch-sdk

Library Featured

Rust wrapper for the Meilisearch API. Meilisearch is a powerful, fast, open-source, easy to use and deploy search engine.

Checked · Sources

Downloads
170,111
Dependents
16
Stars
431
Forks
116
Contributors
73
Commits
1,575
Latest release
0.33.0 ·

About

From the project README ·

Meilisearch-Rust

Meilisearch Rust SDK

Meilisearch | Meilisearch Cloud | Documentation | Discord | Roadmap | Website | FAQ

⚡ The Meilisearch API client written for Rust 🦀

Meilisearch Rust is the Meilisearch API client for Rust developers.

Meilisearch is an open-source search engine. Learn more about Meilisearch.

Table of Contents

  • 📖 Documentation
  • 🔧 Installation
  • 🚀 Getting started
  • 🌐 Running in the Browser with WASM
  • 🤖 Compatibility with Meilisearch
  • ⚙️ Contributing

📖 Documentation

This readme contains all the documentation you need to start using this Meilisearch SDK.

For general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our main documentation website.

🔧 Installation

To use meilisearch-sdk, add this to your Cargo.toml:

[dependencies]
meilisearch-sdk = "0.33.0"

The following optional dependencies may also be useful:

futures = "0.3" # To be able to block on async functions if you are not using an async runtime
serde = { version = "1.0", features = ["derive"] }

This crate is async but you can choose to use an async runtime like tokio or just block on futures. You can enable the sync feature to make most structs Sync. It may be a bit slower.

Read the full README

Using this crate is possible without serde, but a lot of features require serde.

Run Meilisearch

⚡️ Launch, scale, and streamline in minutes with Meilisearch Cloud—no maintenance, no commitment, cancel anytime. Try it free now.

🪨 Prefer to self-host? Download and deploy our fast, open-source search engine on your own infrastructure.

🚀 Getting started

Add Documents
use meilisearch_sdk::client::*;
use serde::{Serialize, Deserialize};
use futures::executor::block_on;

#[derive(Serialize, Deserialize, Debug)]
struct Movie {
    id: usize,
    title: String,
    genres: Vec<String>,
}


#[tokio::main(flavor = "current_thread")]
async fn main() {
    // Create a client (without sending any request so that can't fail)
    let client = Client::new(MEILISEARCH_URL, Some(MEILISEARCH_API_KEY)).unwrap();

    // An index is where the documents are stored.
    let movies = client.index("movies");

    // Add some movies in the index. If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.
    movies.add_documents(&[
        Movie { id: 1, title: String::from("Carol"), genres: vec!["Romance".to_string(), "Drama".to_string()] },
        Movie { id: 2, title: String::from("Wonder Woman"), genres: vec!["Action".to_string(), "Adventure".to_string()] },
        Movie { id: 3, title: String::from("Life of Pi"), genres: vec!["Adventure".to_string(), "Drama".to_string()] },
        Movie { id: 4, title: String::from("Mad Max"), genres: vec!["Adventure".to_string(), "Science Fiction".to_string()] },
        Movie { id: 5, title: String::from("Moana"), genres: vec!["Fantasy".to_string(), "Action".to_string()] },
        Movie { id: 6, title: String::from("Philadelphia"), genres: vec!["Drama".to_string()] },
    ], Some("id")).await.unwrap();
}

With the uid, you can check the status (enqueued, canceled, processing, succeeded or failed) of your documents addition using the task.

Basic Search
// Meilisearch is typo-tolerant:
println!("{:?}", client.index("movies_2").search().with_query("caorl").execute::<Movie>().await.unwrap().hits);

Output:

[Movie { id: 1, title: String::from("Carol"), genres: vec!["Romance", "Drama"] }]

Json output:

{
  "hits": [{
    "id": 1,
    "title": "Carol",
    "genres": ["Romance", "Drama"]
  }],
  "offset": 0,
  "limit": 10,
  "processingTimeMs": 1,
  "query": "caorl"
}
Custom Search
let search_result = client.index("movies_3")
  .search()
  .with_query("phil")
  .with_attributes_to_highlight(Selectors::Some(&["*"]))
  .execute::<Movie>()
  .await
  .unwrap();
println!("{:?}", search_result.hits);

Json output:

{
    "hits": [
        {
            "id": 6,
            "title": "Philadelphia",
            "_formatted": {
                "id": 6,
                "title": "<em>Phil</em>adelphia",
                "genre": ["Drama"]
            }
        }
    ],
    "offset": 0,
    "limit": 20,
    "processingTimeMs": 0,
    "query": "phil"
}
Custom Search With Filters

If you want to enable filtering, you must add your attributes to the filterableAttributes index setting.

let filterable_attributes = [
    "id",
    "genres",
];
client.index("movies_4").set_filterable_attributes(&filterable_attributes).await.unwrap();

You only need to perform this operation once.

Note that Meilisearch will rebuild your index whenever you update filterableAttributes. Depending on the size of your dataset, this might take time. You can track the process using the tasks.

Then, you can perform the search:

let search_result = client.index("movies_5")
  .search()
  .with_query("wonder")
  .with_filter("id > 1 AND genres = Action")
  .execute::<Movie>()
  .await
  .unwrap();
println!("{:?}", search_result.hits);

Json output:

{
  "hits": [
    {
      "id": 2,
      "title": "Wonder Woman",
      "genres": ["Action", "Adventure"]
    }
  ],
  "offset": 0,
  "limit": 20,
  "estimatedTotalHits": 1,
  "processingTimeMs": 0,
  "query": "wonder"
}
Customize the HttpClient

By default, the SDK uses reqwest to make http calls. The SDK lets you customize the http client by implementing the HttpClient trait yourself and initializing the Client with the new_with_client method. You may be interested by the futures-unsend feature which lets you specify a non-Send http client.

Wasm support

The SDK supports wasm through reqwest. You'll need to enable the futures-unsend feature while importing it, though.

🌐 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 our demo.

WARNING: meilisearch-sdk will panic if no Window is available (ex: Web extension).

🤖 Compatibility with Meilisearch

This package guarantees compatibility with version v1.x of Meilisearch, but some features may not be present. Please check the issues for more info.

⚙️ 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.

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
None found
  • No native code found
Python bindings
No Python binding crate found
License
MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

meilisearch-sdk beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
meilisearch-sdk This page Featured

Rust wrapper for the Meilisearch API. Meilisearch is a powerful, fast, open-source, easy to use and deploy search engine.

170,111 downloads over 30 days 16 431 0.33.0 GPU support unknown No native code found MIT
meilisearch App Featured

A lightning-fast search engine API bringing AI-powered hybrid search to your sites and applications.

5,660 binary downloads per release Not applicable 59,815 Not measured Not measured Not measured
splintr Listed

Tokenizer for Rust and Python: pure Rust by default, with 18 bundled vocabularies and four backends covering BPE, SentencePiece and WordPiece. Its output matches Hugging Face tokenizers id for id on 14 model families, including GPT-2, Qwen, Whisper, T5 and BERT.

Python bindings

8,204 downloads over 30 days 7 63 0.22.2 GPU support unknown Binds native code: pcre2-sys (feature pcre2) MIT
ck App Listed

Local first semantic and hybrid BM25 grep / search tool for use by AI and humans!

1,775 binary downloads per release Not applicable 1,772 0.8.1 GPU support unknown Binds native code: tree-sitter, tree-sitter-language, openssl-sys (feature openssl), ort-sys (feature mixedbread) Apache-2.0 OR MIT
semtools App Listed

Semantic search and document parsing tools for the command line

541 binary downloads per release Not applicable 1,882 3.0.1 GPU support unknown Binds native code: zstd-sys (feature workspace) MIT
tinysearch App Listed

🔍 Tiny, full-text search engine for static websites built with Rust and Wasm

147 binary downloads per release Not applicable 2,980 Not measured Not measured Apache-2.0
trieve App Listed

All-in-one platform for search, recommendations, RAG, and analytics offered via API

9 binary downloads per release Not applicable 2,723 Not measured Not measured MIT
Why FeaturedIt passes every Featured gate.

What it meets

  • It has 11 active dependents and 10 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days.
  • Active dependents are at 100% of their peak. Featured needs at least 50%.
  • Docs are present. The release commit or a manifest ties the crate to the repository.
  • No vulnerability advisory stays unpatched past the grace window. At least one version is neither a prerelease nor 0.0.x.
  • The last activity is on 4 Nov 2026, 5 days ago. The rules expect an update within 560 days. Dormancy rule

Exact rules: Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 0.33.0 base 140, doubled for 170111 downloads per month, doubled for 11 active users: E = 560 days
  • dormancy: last activity 2026-11-04, 5 days ago, E = 560: active
  • featured: featured: active_users 11, new_adopters 10, former_glory 1

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption11 active dependents, 10 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents11crates.io database dumpYes
New dependents (365 days)10crates.io database dumpYes
Peak active dependents11crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 5 days ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-04GitHub repositoryYes
Latest release2026-04-22crates.io database dumpYes
First release2020-05-03crates.io database dumpYes
Latest version0.33.0crates.io database dumpYes
Days the oldest outside issue waits for a reply567GitHub repositoryYes
Maintainer replies over 365 days4GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution51 releases, 170,111 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases51crates.io database dumpYes
Downloads over 30 days170111crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository431 stars, 116 forks, 73 contributors, 1,575 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars431GitHub repositoryYes — one part of the repository route
GitHub forks116GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account73GitHub contributorsYes — one part of the repository route
Commits on the default branch1575GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseMITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesNo native code foundcrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly16crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.