Skip to content

Getting Started

Flapjack is an open-source search engine with an Algolia-compatible API. This guide gets you from zero to searching in under a minute.

Terminal window
docker run -d -p 7700:7700 \
-e FLAPJACK_ADMIN_KEY=your-secret-key \
-v flapjack-data:/var/lib/flapjack \
ghcr.io/flapjack-search/flapjack

Or download the binary directly:

Terminal window
curl -fSL -o flapjack https://github.com/flapjack-search/flapjack/releases/latest/download/flapjack-linux-arm64
chmod +x flapjack
FLAPJACK_ADMIN_KEY=your-secret-key ./flapjack --data-dir ./data --bind-addr 0.0.0.0:7700
Terminal window
curl http://localhost:7700/health

You should see a 200 OK response.

Terminal window
curl -X POST 'http://localhost:7700/1/indexes/movies/batch' \
-H 'X-Algolia-Application-Id: flapjack' \
-H 'X-Algolia-API-Key: your-secret-key' \
-H 'Content-Type: application/json' \
-d '{
"requests": [
{"action": "addObject", "body": {"objectID": "1", "title": "The Matrix", "year": 1999, "genre": "sci-fi"}},
{"action": "addObject", "body": {"objectID": "2", "title": "Inception", "year": 2010, "genre": "sci-fi"}},
{"action": "addObject", "body": {"objectID": "3", "title": "The Godfather", "year": 1972, "genre": "crime"}}
]
}'
Terminal window
curl -X POST 'http://localhost:7700/1/indexes/movies/query' \
-H 'X-Algolia-Application-Id: flapjack' \
-H 'X-Algolia-API-Key: your-secret-key' \
-H 'Content-Type: application/json' \
-d '{"query": "matrix"}'

Response:

{
"hits": [
{
"objectID": "1",
"title": "The Matrix",
"year": 1999,
"genre": "sci-fi",
"_highlightResult": {
"title": {
"value": "The <em>Matrix</em>",
"matchLevel": "full"
}
}
}
],
"nbHits": 1,
"page": 0,
"hitsPerPage": 20,
"processingTimeMS": 0,
"query": "matrix"
}