algoliasearch

Crates.ioalgoliasearch
lib.rsalgoliasearch
version0.1.7
sourcesrc
created_at2019-04-06 14:38:54.69879
updated_at2024-05-03 09:37:37.383136
descriptionAlgolia client
homepagehttps://github.com/nicompte/algoliasearch-rs
repositoryhttps://github.com/nicompte/algoliasearch-rs
max_upload_size
id126165
size75,547
Nicolas Barbotte (nicompte)

documentation

https://docs.rs/algoliasearch

README

algoliasearch

algoliasearch is a (really incomplete) rust implemention of an algolia client.

Crates.io Documentation Build Status

usage

use algoliasearch::Client;
// needs tokio as a dependency,
// tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread"] }
use tokio;

#[derive(Deserialize)]
struct User {
    name: String,
    age: u32,
}

#[tokio::main]
async fn main() -> Result<(), Box<Error>> {
    // read ALGOLIA_APPLICATION_ID and ALGOLIA_API_KEY from env
    let index = Client::default().init_index::<User>("users");

    let res = index.search("Bernardo").await?;
    dbg!(res.hits); // [User { name: "Bernardo", age: 32} ]

    Ok(())
}

todo

  • Add all the remaining calls
Commit count: 36

cargo fmt