Search Configuration
Vertesia's search backend is Elasticsearch, providing vector, full-text, and hybrid search from a single index. This guide covers how to configure and manage it.
How search works
Documents are indexed in Elasticsearch automatically as they are created and updated, and a single index serves vector, full-text, and hybrid queries:
- Vector similarity — HNSW over document embeddings (
text,image, andproperties) for semantic search - Full-text — stemming, fuzzy matching, and phrase queries
- Hybrid — vector and full-text combined, with configurable weights and score fusion (see Hybrid Search)
- Aggregations — analytics, facets, and document statistics
- DSL queries — full control over search behavior for advanced cases
Configuration
Prerequisites
Elasticsearch requires:
- Elasticsearch infrastructure enabled for your account
- Embeddings configured (for vector search capabilities)
- Project settings permission (
project:settings_write)
Enabling Elasticsearch
Get Status
Check the current Elasticsearch status for your project:
Get Elasticsearch Status
curl --location --request GET \
'https://api.vertesia.io/api/v1/indexing/status' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Example Response:
{
"infrastructure_enabled": true,
"indexing_enabled": true,
"query_enabled": true,
"index": {
"exists": true,
"alias_name": "content_abc123",
"index_name": "content_abc123_v1",
"version": 1,
"created_at": "2024-01-15T10:00:00Z",
"document_count": 15234,
"size_bytes": 52428800
},
"mongo_document_count": 15234,
"reindex_in_progress": false,
"reindex_progress": null
}
Enable Indexing
Enable Elasticsearch indexing for your project. This creates the index and starts syncing documents:
Enable Elasticsearch Indexing
curl --location --request POST \
'https://api.vertesia.io/api/v1/indexing/enable-indexing' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Enable Queries
Enable Elasticsearch Queries
curl --location --request POST \
'https://api.vertesia.io/api/v1/indexing/enable-queries' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Disable Queries
Disable Elasticsearch Queries
curl --location --request POST \
'https://api.vertesia.io/api/v1/indexing/disable-queries' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Disable Indexing
Disable Elasticsearch indexing entirely:
Disable Elasticsearch Indexing
curl --location --request POST \
'https://api.vertesia.io/api/v1/indexing/disable-indexing' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Reindexing
Reindexing rebuilds the Elasticsearch index from MongoDB. This may be needed when:
- Enabling Elasticsearch for an existing project with documents
- Changing embedding dimensions
- Index corruption or sync issues
- Recovering from failures
Trigger Reindex
Trigger Reindex
curl --location --request POST \
'https://api.vertesia.io/api/v1/indexing/reindex' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"recreate_index": false
}'
Parameters:
| Parameter | Type | Description |
|---|---|---|
recreate_index | boolean | If true, drops and recreates the index. Use when changing dimensions or mappings. |
Zero-Downtime Reindexing
Vertesia uses alias-based reindexing for zero downtime:
- A new index is created with updated mappings
- Documents are batch-indexed to the new index
- The alias is atomically swapped from old to new
- The old index is deleted
During reindexing, queries continue to work against the existing index.
Monitoring Progress
Check reindex progress through the status endpoint:
{
"reindex_progress": {
"status": "running",
"processed": 5000,
"total": 15234,
"current_batch": 10,
"total_batches": 31,
"percent_complete": 33
}
}
Drift Analysis
Use drift analysis to measure how Elasticsearch has diverged from MongoDB without rebuilding the index. The analyzer compares documents by _id and updated_at.
Start Drift Analysis
Start Drift Analysis
curl --location --request POST \
'https://api.vertesia.io/api/v1/indexing/analyze-drift' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Check Drift Analysis Status
Get Drift Analysis Status
curl --location --request GET \
'https://api.vertesia.io/api/v1/indexing/drift-analysis' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Example Completed Response:
{
"workflow_id": "analyzeElasticsearchDriftWorkflow:project-abc123",
"workflow_run_id": "019d1edd-3ac9-7dbf-b78d-470c49771180",
"status": "COMPLETED",
"result": {
"total": 15234,
"processed": 15234,
"missing": 8,
"stale": 3,
"sample_missing_ids": [
"65f0c4d7a8f9e7a6e7d3b101"
],
"sample_stale_ids": [
"65f0c4d7a8f9e7a6e7d3b202"
],
"completed_at": "2026-03-24T08:22:11.000Z"
}
}
Hybrid Search
Hybrid search combines full-text and vector search for optimal relevance. When both search types return results, scores are aggregated using configurable methods.
Score Aggregation Methods
| Method | Algorithm | Best For |
|---|---|---|
| RRF | Reciprocal Rank Fusion | When relevance scores from different sources aren't directly comparable |
| RSF | Relevance Score Fusion | When you want to combine normalized scores directly |
| Smart | Automatic selection | General use, automatically picks the best method |
Weight Configuration
Control the relative importance of each search type:
{
"query": {
"full_text": "quarterly report",
"vector": { "text": "financial analysis" },
"weights": {
"full_text": 2,
"vector": 3
}
}
}
Higher weights give more influence to that search type. With the above configuration, vector search results are weighted 1.5x more than full-text results.
Dynamic Scaling
When enabled, dynamic scaling adjusts weights automatically if one search type is unavailable:
{
"query": {
"full_text": "quarterly report",
"vector": { "text": "financial analysis" },
"dynamic_scaling": "on"
}
}
Index Configuration Tools
Agents can query and update index configuration using built-in tools:
get_index_configuration
Retrieves the current index status and configuration.
Returns:
- Index status (exists, healthy)
- Document count and size
- Embedding dimensions for each type
- Field mappings
update_index_configuration
Updates index configuration with options to change embedding dimensions or trigger reindexing.
Parameters:
| Parameter | Type | Description |
|---|---|---|
embedding_dimensions | object | New dimensions for text, image, or properties |
force_reindex | boolean | Trigger a full reindex |
user_confirmed | boolean | Required confirmation (must use ask_user first) |
Troubleshooting
Documents Not Appearing in Search
- Check that indexing is enabled (
indexing_enabled: true) - Verify embeddings are configured and generating
- Allow time for async indexing to complete
- Check for sync issues in status endpoint
Dimension Mismatch Errors
If you changed embedding dimensions:
- Recalculate embeddings with new dimensions
- Trigger reindex with
recreate_index: true
Search Returns No Results
- Verify documents exist in MongoDB (
mongo_document_count) - Check Elasticsearch document count matches
- Test with broader queries or
match_all - Verify query syntax is correct
Reindex Stuck or Failed
- Check workflow status in the Vertesia UI
- Look for errors in workflow history
- Ensure sufficient permissions
- Try triggering a new reindex (will cancel stuck one)
Best Practices
Index Management
- Enable queries only after initial indexing completes
- Monitor document counts between MongoDB and Elasticsearch
- Schedule reindexing during low-traffic periods
Search Configuration
- Start with
smartscore aggregation - Tune weights based on search quality feedback
- Use facets for navigation and filtering
- Enable
analyzefor complex queries that benefit from LLM summarization
Performance
- Use appropriate
limitvalues (avoid fetching more than needed) - Use
count_onlyfor pagination totals - Stream large results to artifacts with
output_artifact - Consider DSL mode for complex aggregations
Next Steps
- Content Overview - Understanding the full search architecture
- Embeddings Configuration - Configure embeddings for vector search
- Built-in Tools - Learn about search_documents and index tools
- Commands API - Full API reference for indexing endpoints
