Product Full-Text Search
lobehub/lobehub
Guides work on LobeHub's own product search: the shared search repository, provider choice, Elasticsearch mappings, change syncing and reindexing.
Design and review Elasticsearch index mappings for stated access patterns: correct field types, text+keyword multi-fields, docvalues tuning, mapping-explosion avoidance, and explicit shard settings.
$ npx skills add elastic/agent-skills --skill elasticsearch-index-design -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install elastic/agent-skills elasticsearch-index-design --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-index-design .claude/skills/elasticsearch-index-design && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "elasticsearch-index-design" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-index-design into .claude/skills/elasticsearch-index-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-index-design", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-index-designType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add elastic/agent-skills --skill elasticsearch-index-design -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install elastic/agent-skills elasticsearch-index-design --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-index-design .agents/skills/elasticsearch-index-design && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "elasticsearch-index-design" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-index-design into .agents/skills/elasticsearch-index-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-index-design", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add elastic/agent-skills --skill elasticsearch-index-design -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install elastic/agent-skills elasticsearch-index-design --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-index-design .cursor/skills/elasticsearch-index-design && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "elasticsearch-index-design" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-index-design into .cursor/skills/elasticsearch-index-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-index-design", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/elastic/agent-skills.git --path skills/elasticsearch/elasticsearch-index-design--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add elastic/agent-skills --skill elasticsearch-index-design -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install elastic/agent-skills elasticsearch-index-design --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-index-design .gemini/skills/elasticsearch-index-design && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "elasticsearch-index-design" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-index-design into .gemini/skills/elasticsearch-index-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-index-design", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install elastic/agent-skills elasticsearch-index-designInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add elastic/agent-skills --skill elasticsearch-index-design -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-index-design .github/skills/elasticsearch-index-design && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "elasticsearch-index-design" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-index-design into .github/skills/elasticsearch-index-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-index-design", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add elastic/agent-skills --skill elasticsearch-index-design -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install elastic/agent-skills elasticsearch-index-design --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-index-design .opencode/skills/elasticsearch-index-design && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "elasticsearch-index-design" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-index-design into .opencode/skills/elasticsearch-index-design/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-index-design", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
elasticsearch-index-designDesign and review Elasticsearch index mappings for stated access patterns: correct field types, text+keyword multi-fields, docvalues tuning, mapping-explosion avoidance, and explicit shard settings.
Elasticsearch Index Design is an agent skill from elastic/agent-skills, published by the product's own GitHub organization. Design and review Elasticsearch index mappings for stated access patterns: correct field types, text+keyword multi-fields, docvalues 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.
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/field-type-decisions.md`, `references/mapping-explosion.md` and `references/multi-field-patterns.md`). Compatibility notes: Elasticsearch 8.x or 9.x, self-managed, Elastic Cloud Hosted, or Elastic Cloud Serverless; explicit shard and replica settings apply to self-managed and…
It sits in Backend & APIs, covering Search implementation. It works with Elasticsearch. The repository describes itself as: Official Elastic Skills. The licence is Apache-2.0.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit baa5111. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are json).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Elasticsearch 8.x or 9.x, self-managed, Elastic Cloud Hosted, or Elastic Cloud Serverless; explicit shard and replica settings apply to self-managed and Elastic Cloud Hosted only (managed internally on Serverless). Requires the `elastic` CLI ≥ 0.2 with `stack es` support.
From compatibility in the SKILL.md frontmatter.
Elasticsearch Index Design loads about 3.1k tokens when it runs, and up to ~6.4k if it reads all its reference files. Until then it costs about 108 tokens; SKILL.md has 1,138 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from elastic/agent-skills at commit baa5111, republished under its Apache-2.0 licence (© elastic). 1,138 words, ~3,110 tokens.
.claude/skills/elasticsearch-index-design/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.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 -->
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 -->
Gather access patterns per field. Before choosing types, list how each field is used. For every field capture:
_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.
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.
Key judgments:
| Pattern | Mapping |
|---|---|
| Full-text search only | text (no keyword sub-field) |
| Filter / agg / sort only | keyword (not text) |
| Full-text search and sort or aggregation | text with fields.keyword multi-field |
| Decimal price or metric | double, float, or scaled_float — not text or integer |
| Timestamp | date |
| True/false flag | boolean |
| Free-form key/value map with many distinct keys | flattened — not dynamic object |
Multi-field rule: When a field must be searchable and sortable/aggregatable (e.g. product name), map it as
text with a keyword sub-field — search on name, sort and aggregate on name.keyword. Mapping as only text or
only keyword is wrong for that combined pattern.
Explicit mapping rule: For new indices, always define mappings explicitly with PUT /{index}. Do not rely on
dynamic mapping for production indices — the first document can lock in wrong types (strings as text, ambiguous
numbers as keyword).
Index settings: Set deliberate number_of_shards and number_of_replicas in the same PUT /{index} request
when the deployment allows it (Self-Managed / Elastic Cloud Hosted). On Serverless, omit shard and replica counts
(Elastic manages them); still supply explicit mappings. State chosen values or document that defaults apply.
Example — products index optimized for search plus sort/agg on name:
{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"properties": {
"name": {
"type": "text",
"fields": {
"keyword": { "type": "keyword", "ignore_above": 256 }
}
},
"price": { "type": "double" },
"created": { "type": "date" },
"in_stock": { "type": "boolean" }
}
}
}Create with PUT /products passing the settings and mappings blocks. Verify with GET /products/_mapping.
Guard against mapping explosion and storage bloat. On high-volume indices, type mistakes multiply cost. Read Mapping Explosion and Storage Bloat and apply these review checks:
url, HTTP status_code,
tags, IDs) must be keyword, not text. text wastes space; aggregations on text require fielddata or a
.keyword sub-field that should not exist if the field is not searched.message.keyword without ignore_above — A keyword sub-field on a large full-text body indexes the entire raw
string as one term. Flag this anti-pattern; remove the sub-field when only full-text search is needed, or add
ignore_above when a bounded exact-match sub-field is truly required.object with "dynamic": true on user-supplied key/value data with thousands of
distinct keys causes mapping explosion. Recommend flattened (or strict dynamic / allowlist strategy).doc_values: false — On fields retrieved in hits but never sorted, aggregated, or filtered (e.g. display-only
session_id), set "doc_values": false on keyword to save disk at scale.scaled_float — For metrics with bounded precision (e.g. response_time_ms), prefer scaled_float with an
appropriate scaling_factor over plain float/double when storage dominates.Prefer "dynamic": "strict" on the root mapping unless unknown fields are an explicit requirement.
Apply design: create new index and reindex when types change. Elasticsearch cannot change an existing field's type in place. When review finds wrong types (text→keyword, object→flattened, float→scaled_float, doc_values changes on existing fields), state clearly that fixes require a new index and reindex — not a mapping update on the live index.
Workflow for correcting an existing high-volume index such as events:
events-v2) incorporating all fixes from steps 2–3.PUT /events-v2 and the full corrected mappings (and settings where
applicable).POST /_reindex — for large indices use wait_for_completion=false and track the task.
Source: { "index": "events" }, destination: { "index": "events-v2" }.GET /events-v2/_count (compare to source count) and GET /events-v2/_mapping (confirm types).Example corrected excerpt for the events review pattern:
{
"mappings": {
"properties": {
"@timestamp": { "type": "date" },
"event_id": { "type": "keyword" },
"session_id": { "type": "keyword", "doc_values": false },
"url": { "type": "keyword" },
"status_code": { "type": "keyword" },
"response_time_ms": { "type": "scaled_float", "scaling_factor": 100 },
"tags": { "type": "keyword" },
"message": { "type": "text" },
"labels": { "type": "flattened" }
}
}
}Do not attempt in-place mapping fixes for these type changes — they are rejected or leave data inconsistent. For
greenfield indices, a single PUT /{index} before first ingest avoids reindex entirely.
When the user supplies a mapping JSON and usage notes, walk this checklist in order:
text on filter/agg-only fields; flag missing multi-fields where search and sort/agg share one logical field.message.keyword (or similar) without ignore_above on large analyzed text.object on high-cardinality free-form maps; recommend flattened.doc_values: false, scaled_float).POST /_reindex, then show the corrected mapping and reindex plan."Users search product names and also sort and aggregate on them" — one logical field, two access patterns, so use a
text field with a keyword multi-field:
{
"mappings": {
"properties": {
"product_name": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }
}
}
}"A status field is only ever filtered and aggregated, never full-text searched" — use keyword, not text:
{ "mappings": { "properties": { "status": { "type": "keyword" } } } }"Free-form labels object with unbounded keys" — avoid mapping explosion with flattened:
{ "mappings": { "properties": { "labels": { "type": "flattened" } } } }GET /{index}/_mapping; use GET /{index}/_count after reindex.POST /_reindex (see the reindex skill for slicing,
throttling, and task tracking). Loading files into a new index is bulk ingest, not index design.ignore_above, anti-patternsflattened, doc_values, dynamic objects| HTTP API (shorthand) | elastic CLI command |
|---|---|
GET / | elastic es info |
GET /{index}/_mapping | elastic es indices get-mapping --index '<index>' |
PUT /{index} | elastic es indices create --index '<index>' --mappings '<json>' --settings '<json>' |
POST /_reindex | elastic es reindex --source '<json>' --dest '<json>' |
POST /_reindex?wait_for_completion=false | elastic es reindex --wait-for-completion false --source '<json>' --dest '<json>' |
GET /{index}/_count | elastic es count --index '<index>' |
© elastic, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 3 other files (references) in skills/elasticsearch/elasticsearch-index-design of elastic/agent-skills.
Open the folder on GitHubat commit baa5111
Elasticsearch Index Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Elasticsearch Index Design this skillelastic/agent-skills | 592 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| Product Full-Text Searchlobehub/lobehub | 83k | — | ~4.1k | Automated safety check: Pass | Custom licence | |
| Foundatio Repositoriesexceptionless/Exceptionless | 2.5k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Elasticsearch Authnaspectrr/deer | 405 | — | ~1.2k | Automated safety check: Notes | MIT | |
| Elasticsearch Authzaspectrr/deer | 405 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Elasticsearch File Ingestaspectrr/deer | 405 | — | ~684 | Automated safety check: Pass | MIT |
lobehub/lobehub
Guides work on LobeHub's own product search: the shared search repository, provider choice, Elasticsearch mappings, change syncing and reindexing.
exceptionless/Exceptionless
Query, aggregate, patch, or paginate Exceptionless data through its Elasticsearch repository abstractions.
aspectrr/deer
Authenticate to Elasticsearch using native, file-based, LDAP/AD, SAML, OIDC, Kerberos, JWT, or certificate realms.
aspectrr/deer
Manage Elasticsearch RBAC: native users, roles, role mappings, document- and field-level security.
aspectrr/deer
Ingest and transform data files (CSV/JSON/Parquet/Arrow IPC) into Elasticsearch with stream processing and custom transforms.
aspectrr/deer
Diagnose and resolve Elasticsearch security errors: 401/403 failures, TLS problems, expired API keys, role mapping mismatches, and Kibana login issues.
elastic/agent-skills
Triage Elastic Security alerts — gather context, classify threats, create cases, and acknowledge.
elastic/agent-skills
Create, search, update, and manage SOC cases via the Kibana Cases API.
elastic/agent-skills
Create, tune, and manage Elastic Security detection rules (SIEM and Endpoint).
elastic/agent-skills
Create and manage Kibana Dashboards and Lens visualizations.
elastic/agent-skills
Generate sample security events, attack scenarios, and synthetic alerts for Elastic Security.
elastic/agent-skills
Onboard an Elastic Cloud organization: configure the elastic CLI's Cloud context and API key, establish a default region, then invite users, assign predefined or custom Serverless project roles, and…
Works with
Categories
Design and review Elasticsearch index mappings for stated access patterns: correct field types, text+keyword multi-fields, docvalues tuning, mapping-explosion avoidance, and explicit shard settings. Elasticsearch Index Design is an agent skill from elastic/agent-skills, published by the product's own GitHub organization. Design and review Elasticsearch index mappings for stated access patterns: correct field types, text+keyword multi-fields, docvalues tuning, mapping-explosion avoidance, and explicit shard settings.
Elasticsearch Index Design fits situations like: creating a new index; reviewing a mapping for storage; query performance; fixing wrong field types.
Run `npx skills add elastic/agent-skills --skill elasticsearch-index-design -a claude-code`. Or copy the skill folder (skills/elasticsearch/elasticsearch-index-design in elastic/agent-skills) into .claude/skills/elasticsearch-index-design in your project. Claude Code loads it when a task matches its description.
Run `npx skills add elastic/agent-skills --skill elasticsearch-index-design -a codex`. Or copy the skill folder (skills/elasticsearch/elasticsearch-index-design in elastic/agent-skills) into .agents/skills/elasticsearch-index-design in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add elastic/agent-skills --skill elasticsearch-index-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/elasticsearch-index-design, .gemini/skills/elasticsearch-index-design, .github/skills/elasticsearch-index-design and .opencode/skills/elasticsearch-index-design in your project.
SKILL.md names no scripts, command-line tools or credentials: Elasticsearch Index Design is instructions for the agent only. Compatibility (from SKILL.md): Elasticsearch 8.x or 9.x, self-managed, Elastic Cloud Hosted, or Elastic Cloud Serverless; explicit shard and replica settings apply to self-managed and Elastic Cloud Hosted only (managed internally on Serverless). Requires the `elastic` CLI ≥ 0.2 with `stack es` support..
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Elasticsearch Index Design is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.3k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Elasticsearch Index Design: Product Full-Text Search (lobehub/lobehub, 83k stars), Foundatio Repositories (exceptionless/Exceptionless, 2.5k stars), Elasticsearch Authn (aspectrr/deer, 405 stars) and Elasticsearch Authz (aspectrr/deer, 405 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
elastic (a GitHub organization, an official publisher) maintains it in elastic/agent-skills, which has 592 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 7, 2026.
Source: elastic/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.