Dust dust-elasticsearch
Create, migrate, or query Elasticsearch indices in `front`. Use when adding a new front Elasticsearch index, changing mappings or settings, wiring indexing logic, or exposing Elasticsearch-backed analytics/search endpoints.
install
source · Clone the upstream repo
git clone https://github.com/dust-tt/dust
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/dust-tt/dust "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/dust-elasticsearch" ~/.claude/skills/dust-tt-dust-dust-elasticsearch && rm -rf "$T"
manifest:
.claude/skills/dust-elasticsearch/SKILL.mdsource content
Front Elasticsearch
Use this skill when working on Elasticsearch-backed features in
front. SKILL.md covers the
default path for routine work. You should only load the supporting references when you need deeper
material such as analyzer design, full curl verification, query recipes, or relocation details.
Default Workflow
- Decide whether you are:
- adding a brand-new index
- shipping a new version of an existing index
- only changing indexing or querying logic on top of an existing alias
- Define the document type under
.front/types/...- Extend
for workspace-scoped indices instead of redeclaringElasticsearchBaseDocument
.workspace_id - Keep a stable primary identifier in the document and include a migration-friendly timestamp
such as
when backfills or version bumps are likely.updated_at
- Extend
- Create versioned mappings and per-region settings under
.front/lib/<feature>/indices/- Prefer
for ids and enums,keyword
for timestamps, numeric field types for metrics,date
only when array element relationships matter, andnested
only when full-text search is actually required.text
- Prefer
- Register the stable alias and index directory in
.front/lib/api/elasticsearch.ts- App code should read and write through the alias, not a concrete versioned index name.
- Create the physical index with
.tsx front/scripts/create_elasticsearch_index.ts- The normal shape is
behind aliasfront.<index_name>_<version>
.front.<index_name>
- The normal shape is
- Add indexing helpers using deterministic document ids and alias-based writes.
- The common pattern is
or an equivalent deterministic key.${workspaceId}_${entityId} - Use
andwithEs(...)
,client.index
, orclient.update
.client.bulk
- The common pattern is
- Add query helpers or endpoints.
- Start with
.bool.filter - Include
for workspace-scoped indices.workspace_id - Use
for aggregation-only queries.size: 0
- Start with
- If indexing is asynchronous or retry-prone, wire it through the shared Temporal ES queue.
- If the index must survive workspace relocation between regions, add the relocation activity and workflow hook.
Core Rules
- Keep one mappings file per index version and one settings file per region.
- Use version bumps for incompatible mapping or analyzer changes rather than mutating a live index in place.
- Simple analytics indices usually do not need custom analyzers or Elasticsearch plugins.
- If you need prefix search, multi-field mappings, ICU analyzers, or email-aware tokenization, read references/create-index.md before editing mappings.
- Prefer async indexing through
when the write path does not need to block on Elasticsearch freshness.front/temporal/es_indexation/* - Check relocation requirements for any workspace-scoped index that is expected to remain available after workspace region moves.
Current Architecture
This skill focuses on Elasticsearch indices managed in
front, especially analytics-style indices,
but the patterns also match the broader Dust Elasticsearch setup.
Current examples to copy from:
front.agent_message_analytics- version
2 - write alias
front.agent_message_analytics - basic mappings, no custom analyzers
- version
core.data_sources_nodes- version
4 - write alias
core.data_sources_nodes - advanced analyzers, edge n-grams, multi-field mappings, and normalizers
- version
The general pattern is:
- versioned physical indices such as
front.<index_name>_<version> - one stable alias such as
for app reads and writesfront.<index_name> - mappings and region-specific settings stored alongside the feature code
Primary Files
front/lib/api/elasticsearch.tsfront/scripts/create_elasticsearch_index.tsfront/lib/*/indices/*.mappings.jsonfront/lib/*/indices/*.settings.{region}.jsonfront/temporal/es_indexation/*front/temporal/relocation/activities/destination_region/front/es_indexation.tsfront/temporal/relocation/workflows.ts
Existing References In Code
front/lib/user_search/indices/front/lib/user_search/index.tsfront/lib/analytics/indices/core/src/search_stores/indices/data_sources_nodes_4.*
Validation
- The document type and mappings agree on field names and field kinds.
- The index has a stable alias constant and an
entry.INDEX_DIRECTORIES - The version in the script invocation matches the versioned mappings/settings filenames.
- Writes target the alias constant rather than a concrete versioned index name.
- Query helpers filter by
when the index is workspace-scoped.workspace_id - Aggregation-only queries use
.size: 0 - Temporal integration exists when indexing is asynchronous or needs retries.
- Relocation support exists when the index must be rebuilt in a destination region.
Supporting References
- Environment setup and plugin checks: references/overview.md
- Full index creation and migration details, including analyzers and curl verification: references/create-index.md
- Indexing helper and Temporal examples: references/indexing.md
- Query and aggregation patterns: references/querying.md
- Workspace relocation support: references/relocation.md