Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myxogastria0808/meilisearch-rust-mytutorial
https://github.com/myxogastria0808/meilisearch-rust-mytutorial
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/myxogastria0808/meilisearch-rust-mytutorial
- Owner: Myxogastria0808
- Created: 2024-08-25T04:07:02.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-25T14:29:46.000Z (4 months ago)
- Last Synced: 2024-08-25T15:32:23.336Z (4 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/