A proof-of-concept search service, powered by Meilisearch and meilisearch-go.
Directory | Description |
---|---|
./cmd |
CLI for making gRPC requests |
./idl |
Protobufs (Interface Definition Language) |
./internal/app |
App dependency injection / initialization |
./internal/idl |
Auto-generated protobufs |
./internal/service |
Service layer / Business logic |
docker-compose up -d
go run main.go
Check out the full API.
Generate a fake CSV file of drivers with
go run cmd/search/*.go generate --size 1000
You can view its contents with:
xsv sort --select last_name,first_name fake-drivers.csv | xsv table | bat --file-name fake-drivers.csv
Index the CSV records into Meilisearch with:
go run cmd/search/*.go ingest drivers --file fake-drivers.csv
Perform a search query with:
go run cmd/search/*.go query --query Nichole
Response would look like:
{
"hits": [
{
"driver": {
"id": "c9q7k6vrirfhbdec6e00",
"firstName": "Nichole",
"lastName": "Bailey",
"email": "[email protected]",
"phone": "108-674-1932"
}
}
]
}