---
name: "elasticsearch-dsl-index-lifecycle"
description: "Design production Elasticsearch mappings, complex Boolean DSL queries, and automated ILM rollover."
metadata:
  author: "Elastic"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write elasticsearch bool query"
  - "configure elasticsearch ilm policy"
  - "create custom analyzer elasticsearch"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Elasticsearch DSL & Index Lifecycle Management (ILM)

Builds enterprise search on Elasticsearch: mapping analyzers (custom edge_ngram, standard, phonetic), complex bool queries, nested object queries, and configuring hot-warm-cold ILM data tiers.

## When to Invoke
Invoke this skill whenever you need to:
- write elasticsearch bool query
- configure elasticsearch ilm policy
- create custom analyzer elasticsearch

## Execution SOP & Rules
1. Define index settings with custom analysis: analyzers, tokenizers, and token filters.
2. Structure bool query placing filter clauses for exact non-scoring matches to leverage node cache.
3. Create ILM policy: PUT _ilm/policy/logs_policy defining hot, warm, and cold phase transitions.
4. Monitor cluster health and shard allocation using GET _cat/health and GET _cat/shards.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
