Skip to content

Instantly share code, notes, and snippets.

View irevoire's full-sized avatar
🦔

Tamo irevoire

🦔
View GitHub Profile
#[derive(Debug)]
pub struct Machin {
pub s: String,
pub a: String,
}
fn main() {
let machin = Machin { s: String::from("s"), a: String::from("a") };
let s = machin.s;
let a = machin.a;
@irevoire
irevoire / main.rs
Last active June 1, 2021 18:12
A fsm you can serialize with serde only on some state
use std::marker::PhantomData;
use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize)]
struct A;
#[derive(Debug, Serialize)]
struct B;
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
@irevoire
irevoire / lib.md
Last active July 27, 2021 11:02
meilisearch lib.rs

MeiliSearch

Hello there, future contributors. If you are here and see this code, it's probably because you want to add a super new fancy feature in MeiliSearch or fix a bug and first of all, thank you for that!

To help you in this task, we'll try to do a little overview of the project.

Milli is the core library of MeiliSearch, it's where we actually index documents and perform searches. It's aim is to do theses two tasks as fast as possible. You can give an update to milli and it'll uses as many cores as provided to perform it as fast as possible. Nothing more. You can perform searches at the same time (search only use one core). As you can see we're missing quite a lot of features here, milli does not handle multiples indexes, it can't queue updates, it doesn't provide any web / API frontend, it doesn't implements dumps or snapshots, etc...

The index module is what encapsulate one milli index. It abstracts over its transaction an