OpenSearch and Elasticsearch — mappings and analyzers, relevance tuning (BM25, boosts, function score), aggregations, index lifecycle, shard sizing, reindexing with aliases, near-real-time indexing from a source of truth, hybrid lexical and vector search. Use for search and log indexes (OpenSearch, Elasticsearch, mapping, analyzer, relevance, reindex).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Opensearch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-opensearch)
---
name: opensearch
description: OpenSearch and Elasticsearch — mappings and analyzers, relevance tuning (BM25, boosts, function score), aggregations, index lifecycle, shard sizing, reindexing with aliases, near-real-time indexing from a source of truth, hybrid lexical and vector search. Use for search and log indexes (OpenSearch, Elasticsearch, mapping, analyzer, relevance, reindex).
metadata:
category: data
---
# OpenSearch
## Purpose
Deliver relevant, fast search on an index kept consistent with its source.
**Use when:** full-text search and analytics indexes.
**Not for:** primary storage.
## Inputs
- Documents, queries, relevance expectations.
## Outputs
- Mappings, analyzers, query templates, relevance evaluation.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "opensearch"` for prior decisions, patterns and anti-patterns.
## Steps
1. **Mapping.** Explicit mappings; analyzers per language; keyword subfields.
Done when no dynamic mapping surprises.
2. **Sync.** Index from the source of truth via events or CDC; idempotent upserts.
Done when index rebuildable.
3. **Relevance.** Judgement list and metrics (nDCG) before/after tuning.
Done when tuning is measured.
4. **Operate.** Shard sizing, ILM, aliases for zero-downtime reindex.
Done when reindex procedure documented.
## Best practices
- Alias-based reindexing.
- Avoid deep pagination; use search_after.
## Common mistakes
- Too many small shards.
- Tuning relevance by anecdote.
## Example
Product search: edge n-gram for autocomplete, synonym set, nDCG@10 0.62 → 0.74 on 200 judged queries.
## Reusable prompt
```text
Apply the OpenSearch skill (.agents/skills/opensearch/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Design mappings, sync, relevance evaluation and index operations for the search use case.
Return: Mappings, analyzers, query templates, relevance evaluation..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```