mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 08:44:27 +01:00
Merge pull request #195 from meilisearch/update-readme
Update the README
This commit is contained in:
commit
369461e635
39
README.md
39
README.md
@ -59,35 +59,24 @@ We have seen much better performances when [using jemalloc as the global allocat
|
|||||||
|
|
||||||
## Usage and examples
|
## Usage and examples
|
||||||
|
|
||||||
You can try a little part of MeiliDB with the following commands.
|
Currently MeiliDB do not provide an http server but you can run these two examples to try it out.
|
||||||
It creates an index named _movies_ and insert two great Tarantino movies in it.
|
|
||||||
|
It creates an index named _movies_ and insert _19 700_ (in batches of _1000_) movies into it.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo run --release
|
cargo run --release --example create-database -- \
|
||||||
|
--schema examples/movies/schema-movies.toml \
|
||||||
curl -XPOST 'http://127.0.0.1:8000/movies' \
|
--update-group-size 1000 \
|
||||||
-d '
|
movies.mdb \
|
||||||
identifier = "id"
|
examples/movies/movies.csv
|
||||||
|
|
||||||
[attributes.id]
|
|
||||||
stored = true
|
|
||||||
|
|
||||||
[attributes.title]
|
|
||||||
stored = true
|
|
||||||
indexed = true
|
|
||||||
'
|
|
||||||
|
|
||||||
curl -H 'Content-Type: application/json' \
|
|
||||||
-XPUT 'http://127.0.0.1:8000/movies' \
|
|
||||||
-d '{ "id": 123, "title": "Inglorious Bastards" }'
|
|
||||||
|
|
||||||
curl -H 'Content-Type: application/json' \
|
|
||||||
-XPUT 'http://127.0.0.1:8000/movies' \
|
|
||||||
-d '{ "id": 456, "title": "Django Unchained" }'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Once the database is initialized you can query it by using the following command:
|
Once this is done, you can query this database using the second binary example.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -XGET 'http://127.0.0.1:8000/movies/search?q=inglo'
|
cargo run --release --example query-database -- \
|
||||||
|
movies.mdb \
|
||||||
|
--fetch-timeout-ms 50 \
|
||||||
|
-n 4 \
|
||||||
|
id title overview release_date poster
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user