meilisearch / meilisearch-rust

Rust wrapper for the Meilisearch API.

Home Page:https://www.meilisearch.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create more examples

irevoire opened this issue · comments

commented

Description
It would be great to add more well-commented examples to show how to use this crate.

Basic example
See #245

Other
A new release of rust-doc should come out in some months that automatically scrap the content of our examples directory to show how to use each function, so adding more examples would also improve the documentation significantly.

Since the feature is still in beta right now it's hard to show you what it'll do but you can see an example here

I'll take this issue

commented

Hello, @salugi. Thank you for your interest!

Currently, we have almost no example; you can create whatever you want.
But keep in mind that an example must be easy to understand and thus heavily commented on!

Let me know if you need help or are not sure about something. I would not mind reading a half-finished PR 👍

@irevoire
thank you, I appreciate the help.
Seeing the example, it has an already running instance of meilisearch. Can I write a simple lib that requires the local melisearch server to be running kinda akin to the quick start?
What kind of assumptions should I make about the user looking at the example?
I'll take a little time to think of a good/cohesive example.

commented

Usually, for all the SDK, we assume there is a running instance on localhost:7700 with the --master-key masterKey.

@irevoire hey, I've been reading through the documents and I started a command line example. I'm going to add some more as I read more through the document. If you could take a look at it quick, it would be much appreciated. I built a repo so I could work on it.
my repo

What I'm unsure of:
Is this a good start?
Are the ranking rules wrong? In the index using the base stuct, i want the hits to be ranked by cost. I'm unsure of what i'm doing wrong
Lastly, is there anything I should look into.
I've been working on making sure the example doesn't introduce new dependencies, so its simple. Any direction would be much appreciated!

commented

Hey @salugi, just to be sure, do you want to merge this into meilisearch-rust, or do you want to keep the maintenance for you, and we could put a link to your repo in our readme?
Personally, I would prefer it if we could put your example in our examples directory; we'll ensure that it always compiles and it'll be easier for our users to find the example 😁

I'll answer your question and make a few issues / PRs directly on your repo 👍