Agent skill · elastic

elasticsearch-index-design

Design and review Elasticsearch index mappings for stated access patterns: correct field types, text+keyword multi-fields, doc_values tuning, mapping-explosion avoidance, and explicit shard settings. Use when creating a new index, reviewing a mapping for storage or query performance, fixing wrong field types, or when the user asks which type to use for search, filter, sort, or aggregation on a field.

What it needs

About 6k tokens when loaded.

What this skill does

Elasticsearch Index Design Design explicit index mappings from access patterns, review existing mappings for type and storage mistakes, and apply corrections through a new index plus reindex when field types must change. <!-- begin-partial: preamble --> Environment Configuration This skill executes Elasticsearch operations through the elastic CLI. If the elastic CLI is not installed, tell the user what it is needed for. Do not guess credentials, call the HTTP API directly, or attempt other workarounds. This skill references operations in HTTP-shorthand form (e.g., GET /, GET /cat/indices, GET /{index}/mapping, GET /{index}/settings/index.mode, POST /query). The Operations table at the end of this document maps each shorthand to the equivalent elastic CLI command — always use the CLI rather than calling the HTTP API directly. <!-- end-partial: preamble --> Process 1. Gather access patterns per field. Before choosing types, list how each field is used. For every field capture: Search — full-text match, phrase, relevance scoring? Filter — exact term, terms set, prefix? Aggregate — terms, cardinality, histogram, stats? Sort — ascending/d descending in result sets? Retrieve only — returned in source but never queried? The decision: classify each field into one primary access pattern (search, exact, numeric metric, date, boolean, structured object, or retrieve-only). Missing access-pattern data is a blocker — ask the user rather than guessing. Call GET / to confirm connectivity; when reviewing an existing index, call GET /{index}/mapping to ground the discussion in the current mapping. 2. Choose field types from access patterns. Map each field to the minimal type set that satisfies its pattern. Read Field Type Decisions and Multi-Field Patterns before proposing mappings. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills elastic/elasticsearch-index-design

View the source on GitHub

Browse the @skills marketplace