Open MercatoDocsSearch docsAPI reference

User guide

Search the back office

Use the global search shortcut to find records or pages across enabled modules. Which results appear depends on indexed data, enabled search strategies and your access.

Global Search (Cmd+K)

Press Cmd+K (Mac) or Ctrl+K (Windows/Linux) anywhere in the backend to open the global search palette.

Global search dialog

The search palette shows results from customers, notes, deals, and todos with direct links to their detail pages.

Search Strategies

Open Mercato supports three complementary search strategies:

StrategyLabelDescriptionBest For
MeilisearchFuzzyFast full-text search with typo toleranceQuick keyword lookups, partial matches
VectorSemanticAI-powered search using embeddingsConceptual queries, natural language
TokensExactHash-based search in PostgreSQLAlways available, encrypted data

When multiple strategies are configured, results are merged using RRF to surface the most relevant matches.

Prerequisites

Meilisearch provides the fastest search experience with typo tolerance and instant results.

# Add to your .env
MEILISEARCH_HOST=http://localhost:7700
MEILISEARCH_API_KEY="<meilisearch-api-key>"

Run Meilisearch locally with Docker:

docker run -d --name meilisearch \
  -p 7700:7700 \
  -e MEILI_ENV=development \
  -e MEILI_MASTER_KEY="$MEILI_MASTER_KEY" \
  getmeili/meilisearch:latest

Vector Search (Optional)

Vector search enables semantic understanding of queries. The shipped example env keeps vector auto-indexing disabled by default, so configure at least one embedding provider and then opt in to automatic indexing if you want live embedding updates:

ProviderEnvironment Variable
OpenAI (default)OPENAI_API_KEY="<openai-api-key>"
Google Generative AIGOOGLE_GENERATIVE_AI_API_KEY="<google-generative-ai-api-key>"
MistralMISTRAL_API_KEY=...
CohereCOHERE_API_KEY=...
Amazon BedrockAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION
Ollama (local)OLLAMA_BASE_URL=http://localhost:11434

Without a configured provider, semantic search is disabled but other strategies continue working. With a provider configured and OM_DISABLE_VECTOR_SEARCH_AUTOINDEXING=true, you can still run manual vector reindex jobs; automatic indexing just stays off.

Token Search (Built-in)

Token-based search requires no configuration. It uses hashed tokens stored in PostgreSQL, making it suitable for encrypted data.

Configuration

Navigate to Settings > Module Configuration > Search Settings to manage:

Search settings page

Environment Variables

VariableEffect
MEILISEARCH_HOSTEnables Meilisearch (Fuzzy) strategy
MEILISEARCH_API_KEYAuthentication key for Meilisearch
OPENAI_API_KEY (or other provider key)Configures a vector embedding provider
OM_DISABLE_VECTOR_SEARCH_AUTOINDEXING=trueKeeps automatic vector indexing disabled (default in shipped example envs)
OM_DISABLE_VECTOR_SEARCH_AUTOINDEXING=falseEnables automatic vector indexing
DISABLE_VECTOR_SEARCH_AUTOINDEXING=1Legacy alias for keeping automatic vector indexing disabled

What Gets Indexed

Modules define searchable entities via search.ts configuration files. The default installation includes:

Custom modules can opt-in by exporting a search.ts file alongside their module metadata.

Reindexing

From CLI

# Reindex all strategies for a tenant
yarn mercato search reindex --tenant <tenantId>

# Reindex specific entity
yarn mercato search reindex --tenant <tenantId> --entity customers:person

From API

# Meilisearch reindex
POST /api/search/reindex
{ "action": "reindex" }

# Vector embeddings reindex
POST /api/search/embeddings/reindex
{ "purgeFirst": true }

From Settings UI

Use the reindex buttons in Settings > Module Configuration > Search Settings for:

Search reindex options

Encryption-Aware Indexing

The search module automatically protects sensitive data:

Field policies are defined per entity in the module's search.ts configuration.

Tenant Isolation

All search strategies enforce tenant isolation:

Warning · Changing embedding providers

Switching embedding providers or models requires a full reindex because embeddings from different models are incompatible. Vector search will be unavailable until reindexing completes.

Previous: Scheduled Jobs · Next: Self-service onboarding