api-search

Lines Of Code

A proof-of-concept search service, powered by Meilisearch.

Project structure

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

Getting started

docker-compose up -d
go run main.go

Usage

Check out the full API.

Ingestion

Generate a fake CSV file of drivers with

go run cmd/search/*.go generate

Then index the CSV in Meilisearch with:

go run cmd/search/*.go ingest drivers --file fake-drivers.csv

Querying

Perform a search 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"
      }
    }
  ]
}

GitHub

View Github