Meilisearch
Set up Meilisearch to enable conversation search in IntelliAsk
Meilisearch is an open-source search engine that powers IntelliAsk's conversation search, adding full-text search, typo tolerance, and instant results across past conversations. For a feature overview, see Search in IntelliAsk.
How it connects
IntelliAsk talks to Meilisearch over HTTP using a few environment variables. The Docker setup ships Meilisearch as a service for you. A source install points IntelliAsk at a Meilisearch process you run yourself.
Configure Meilisearch
The default docker-compose.yml already includes a meilisearch service, so you only need to enable search and set a master key in your .env file.
Generate a master key. Use any sufficiently long, random string (16 bytes or more). For example:
Add the search variables to .env. The Compose file sets MEILI_HOST to the internal service address for the api container, so you don't set the host here. The bundled meilisearch service reads MEILI_MASTER_KEY from this same file, so IntelliAsk and Meilisearch use the same key without any override.
Start the stack. Compose starts Meilisearch alongside IntelliAsk.
Keep the port internal
Containers reach Meilisearch over the internal Docker network, so there is no need to publish port 7700 to the host. Exposing it publicly can leave your search data vulnerable.
Once configured, IntelliAsk indexes conversations and messages into Meilisearch, and the search bar returns full-text results with typo tolerance.
Reindexing after v0.8.8
IntelliAsk v0.8.8 adds an internal indexed-projection version to conversations and messages. On the first synchronization after upgrading, existing documents without the current marker are treated as stale and reindexed automatically so newer searchable fields, including message-backed sidebar results, are present in Meilisearch.
No manual reset is required for this migration. Large installations may see temporarily elevated MongoDB, Meilisearch, and indexing-worker load while the stale documents are processed. In a multi-node deployment, keep synchronization enabled on only one IntelliAsk node as described below.
Environment Variables
| Variable | Description |
|---|---|
SEARCH | Enables the conversation search feature. Set to true. |
MEILI_HOST | URL where IntelliAsk reaches Meilisearch. In Docker this is http://meilisearch:7700 (set by Compose); from source it is typically http://localhost:7700. |
MEILI_MASTER_KEY | Shared secret used to authenticate with Meilisearch. Must match the key Meilisearch starts with. |
MEILI_NO_ANALYTICS | Disables Meilisearch's anonymous telemetry. Set to true. |
MEILI_NO_SYNC | See multi-node setups. |
Search Result Limits
Each search asks Meilisearch for up to 1,000 hits, which is Meilisearch's default pagination.maxTotalHits. The sidebar search combines matches from the conversation index (titles and tags) and the message index before loading the chat list, so a very common word can match more conversations than appear. Raising maxTotalHits on your Meilisearch indexes does not raise the 1,000-hit request size IntelliAsk uses.
Disable Sync in a Multi-node Setup
If you run IntelliAsk as a node cluster or multi-node deployment, leave synchronization enabled on one instance and set MEILI_NO_SYNC=true on every other instance. This prevents redundant indexing work across nodes.
Reset Synchronization
If Meilisearch data is deleted or corrupted, or IntelliAsk treats everything as synced when it isn't (for example after upgrading Meilisearch or deleting its data files), use the reset script to force a full re-sync. It resets the synchronization flags in MongoDB, which triggers IntelliAsk to re-index all conversations and messages on the next startup or sync check.
Run the reset script. Use the command that matches your setup.
Restart IntelliAsk. Re-synchronization begins once the app restarts.
The script asks for confirmation (y/N) before changing anything, so run it in an interactive terminal. It resets the _meiliIndex flag to false for all messages and conversations in MongoDB, then reports how many documents were reset and how many remain to be synced.
When to use it:
- After deleting Meilisearch data files
- When upgrading Meilisearch to a version that requires reindexing
- When IntelliAsk shows conversations as fully synced but Meilisearch is missing data
- After restoring a MongoDB backup without matching Meilisearch data
Advanced sync options. After resetting, control the sync behavior with these environment variables:
| Variable | Default | Description |
|---|---|---|
MEILI_SYNC_BATCH_SIZE | 100 | Number of documents synced per batch. The reset script also uses this value for the size of its flag-reset batches, defaulting to 1000 there. |
MEILI_SYNC_DELAY_MS | 100 | Delay between sync batches, in milliseconds. Also used between the reset script's batches. |
MEILI_SYNC_THRESHOLD | 1000 | Minimum number of unsynced documents before a sync is triggered. |
Last updated on