GGlyphDocs

configuration

Search Engine

Meilisearch v1.7 powers global search. Configuration, indices, and rebuilds.

Glyph uses Meilisearch v1.7 as its search backend. It runs in a dedicated Docker container alongside MySQL and the backend.

Container details

Value
Imagegetmeili/meilisearch:v1.7
Container nameglyph-meilisearch
Volume./volumes/meilisearch (bind mount on host)
Internal port7700 (not exposed externally)
Master keyfrom MEILISEARCH_KEY env var
Modeproduction

The backend connects to http://meilisearch:7700 over the internal Docker network. The port is not published to the host - Meilisearch is unreachable from outside.

Indices

Glyph maintains three indices, automatically created and updated:

IndexDocumentsSearchable fields
projects-<workspace_id>One per projectname, description
files-<workspace_id>One per file in each projectpath, content
docs-<workspace_id>One per documentation entrycontent, file_path, commit_sha

Per-workspace indices ensure search results never cross workspace boundaries.

When indexing happens

EventReindexes
Project importAll files of the new project
Project syncFile tree at the new HEAD
Documentation saveThe single edited doc
Project deleteAll entries are removed

There is no "rebuild all indices" button in the UI. To force a rebuild, see below.

Manual rebuild

If indices get out of sync (e.g. after restoring a database backup that's newer than your Meilisearch volume):

Option 1 - Trigger sync per project

From each project page, click Sync. This reindexes all files at the current HEAD.

Option 2 - Wipe and let Glyph rebuild

docker compose stop meilisearch
sudo rm -rf volumes/meilisearch/*
docker compose start meilisearch

Then trigger a sync on each project to repopulate indices. Documentation entries will be reindexed lazily on the next save.

Resource usage

Meilisearch is light: typically 100-500 MB of RAM, a few hundred MB of disk for the indices on most installs.

For very large monorepos (millions of LOC), the file content index can grow into the gigabytes. Adjust the host's available memory accordingly.

Master key

MEILISEARCH_KEY protects the Meilisearch HTTP API. Even though the port isn't exposed, set a strong random value - defense in depth costs nothing.

openssl rand -hex 32

Changing MEILISEARCH_KEY requires restarting both the meilisearch and backend containers. The backend stores the key in memory at startup.

Replacing Meilisearch

Not supported. Glyph uses Meilisearch-specific features (typo tolerance, ranking rules, sortable attributes). Replacing it would require non-trivial code changes.

Backup

Meilisearch indices can be rebuilt from the database, so backing them up is optional but recommended for faster recovery:

tar czf meilisearch-$(date +%F).tar.gz volumes/meilisearch/

To restore, stop the container, replace the volume contents, restart.