Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/myxogastria0808/meilisearch-rust-mytutorial


https://github.com/myxogastria0808/meilisearch-rust-mytutorial

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Setup

1. プロジェクトの作成

```sh
cargo init
```

2. package を追加

```sh
cargo add meilisearch-sdk
cargo add tokio -F full
cargo add serde
```

3. docker-compose.yaml を作成

```yaml
version: "3.8"

services:
meilisearch:
container_name: meilisearch
image: "getmeili/meilisearch:prototype-japanese-184"
volumes:
- ./meili_data:/meili_data
environment:
#meili cloudを使わない場合、マスターキーは自分で設定する
- MEILI_MASTER_KEY=master_key
- MEILI_ENV=development
ports:
#データ部分をマウント
- "7700:7700"
tty: true
```

4. docker-compose up -d

```sh
docker-compose up -d
```

5. Default Search API Key の取得

参考サイト 2. より引用

```sh
sudo apt install jq
curl -X GET 'http://localhost:7700/keys' -H 'Authorization: Bearer KSjeon19dn3Ls93nFNl349FNS93nkljasIk39fnsa' | jq
```

6. client の生成

```rust
let client: Client = Client::new(
"http://127.0.0.1:7700",
Some(""),
)
.unwrap();
```

## 参考サイト

1. https://github.com/meilisearch/meilisearch-rust

2. https://virment.com/setup-masterkey-and-apikey-for-meilisearch/