alivirgo/major-ai-skills/elasticsearch
Claude Code and agent skill by alivirgo/major-ai-skills
- community
Checking that the SKILL.md file is still in the repository.
Design Elasticsearch mappings, aliases, and ILM; tune bulk ingest with backpressure; secure API auth; plan reindex cutovers and avoid mapping explosions, red shards, and restore index-name traps.
Install
npx vskill@latest install alivirgo/major-ai-skills/elasticsearchSKILL.md
Elasticsearch Search Cluster AI Skill Guide
Overview & Engine Architecture
Elasticsearch is a distributed search and analytics engine: documents in indices (sharded, replicated), mappings define field types, queries use JSON DSL. Ingest is bulk-oriented; coordinators merge shard results. Mapping changes are mostly immutable—plan reindex + alias swap. OpenSearch shares many APIs; verify version-specific behavior.
When to use / when not to
Use when
- Full-text search, faceted browse, log/metrics search at scale
- Time-series indices with ILM rollover and retention
- Aggregations over denormalized documents
Do not use when
- You need primary OLTP with row-level updates as the main pattern (
@postgresql) - Join-heavy relational models without denormalization
- Someone wants dynamic mapping on unbounded user keys in production—block or constrain
Operational Capabilities & Agent Directives
- Connection/auth safety: HTTPS + API keys or native security; never expose
:9200anonymously on the public internet; rotate keys; use least-privilege roles per index pattern. - Mappings: Explicit
propertiesfor prod fields; disable or limit dynamic mapping; usekeywordfor filter/sort/agg,textfor search (multi-fields when both needed). - Aliases: Clients read/write `logs-write` / `logs-read` aliases; reindex to
logs-v2, atomic alias flip—never delete old index until verified. - Backpressure: Bulk with bounded batch bytes/docs; exponential backoff on
429andcircuit_breaking_exception; watch thread pools and indexing pressure. - Index design: Shard count is hard to change—start conservative; use ILM rollover on size/age; avoid oversharding small clusters.
- Backup/restore: Snapshot repositories (S3/GCS); restore creates new indices—rename/alias carefully; snapshot restore is not a merge into live index names without downtime plan.
- Exactly-once myth: Ingest pipelines may retry; use
_idor external version for idempotent indexing; consumers of search results still see near-real-time delay (refresh_interval).
Production examples
Index template + alias
Reindex cutover
Bulk ingest (bounded)
Technical troubleshooting matrix
| Failure signature | Root cause | Diagnostic & fix | |
|---|---|---|---|
| Cluster red | Primary shard missing | Shard allocation explain; restore snapshot | |
| Cluster yellow | Unassigned replicas | Add nodes or reduce replica count | |
circuit_breaking_exception | Heap / fielddata / agg size | Reduce agg size; docvalue_fields; scale heap | |
| Mapping explosion | Dynamic mapping on high-cardinality keys | Strict mapping; reindex | |
| Bulk 429 storm | Indexing pressure / disk watermark | Backoff; ILM rollover; free disk | |
| Search misses new docs | Refresh interval | refresh=wait_for for tests only; accept NRT | |
| Restore overwrote wrong index | Restored snapshot to live name | Restore to new index + re-alias |
Best practices
- Test analyzers with
_analyzebefore shipping multilingual search. - Use data streams + ILM for logs where version supports it.
- Monitor JVM heap, GC, indexing rate, merge throttling, disk watermarks.
- Cross-cluster search/replication: document lag and auth separately.
Limitations
- Relevance tuning is iterative; agents propose experiments with metrics (nDCG, click-through), not magic weights.
- Major version upgrades need compatibility matrices and often reindex.
- Not a substitute for columnar OLAP at petabyte aggregations (
@clickhouse).
Related skills
@opentelemetry— trace/log pipelines into Elastic stack@kafka— ingest buffer before indexing@nginx-hardening— TLS reverse proxy for Kibana/ES
Agent Operational Directive
MANDATORY: Production mapping changes require reindex + alias plan. Never delete indices without confirming alias targets and retention. Bulk ingest must include backoff on 429. Do not disable security for convenience.
Source anchors (research)
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/elasticsearch/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alivirgo/major-ai-skills/elasticsearch)