https://github.com/kevinmichaelchen/api-search
🔎 gRPC layer over the Meilisearch search engine
https://github.com/kevinmichaelchen/api-search
meilisearch
Last synced: 3 months ago
JSON representation
🔎 gRPC layer over the Meilisearch search engine
- Host: GitHub
- URL: https://github.com/kevinmichaelchen/api-search
- Owner: kevinmichaelchen
- Created: 2022-05-06T01:37:57.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-07T19:10:50.000Z (about 3 years ago)
- Last Synced: 2025-02-23T22:43:39.019Z (3 months ago)
- Topics: meilisearch
- Language: Go
- Homepage:
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# api-search
[](https://github.com/kevinmichaelchen/api-search)
A proof-of-concept search service, powered by
[**Meilisearch**](https://www.meilisearch.com/) and
[**meilisearch-go**](https://github.com/meilisearch/meilisearch-go).## Project structure
| Directory | Description |
|----------------------------------------------|-------------------------------------------|
| [`./cmd`](./cmd) | CLI for making gRPC requests |
| [`./idl`](./idl) | Protobufs (Interface Definition Language) |
| [`./internal/app`](./internal/app) | App dependency injection / initialization |
| [`./internal/idl`](./internal/idl) | Auto-generated protobufs |
| [`./internal/service`](./internal/service) | Service layer / Business logic |## Getting started
```bash
docker-compose up -d
go run main.go
```## Usage
Check out the [full API](./idl/coop/drivers/search/v1beta1/api.proto).
### Generating fake documents
Generate a fake CSV file of drivers with
```bash
go run cmd/search/*.go generate --size 1000
```You can view its contents with:
```bash
xsv sort --select last_name,first_name fake-drivers.csv | xsv table | bat --file-name fake-drivers.csv
```### Ingestion
Index the CSV records into Meilisearch with:
```bash
go run cmd/search/*.go ingest drivers --file fake-drivers.csv
```### Querying
Perform a search query with:```bash
go run cmd/search/*.go query --query Nichole
```Response would look like:
```json
{
"hits": [
{
"driver": {
"id": "c9q7k6vrirfhbdec6e00",
"firstName": "Nichole",
"lastName": "Bailey",
"email": "[email protected]",
"phone": "108-674-1932"
}
}
]
}
```