elasticsearch
$
npx mdskill add partme-ai/full-stack-skills/elasticsearchGuides Elasticsearch usage for index mapping, query DSL, bulk indexing, cluster management, and performance tuning.
- Helps implement full-text search, design index mappings, write complex queries, and manage clusters.
- Integrates with Elasticsearch REST API, Kibana, and Logstash for the ELK stack.
- Decides recommendations based on user needs for mapping design, query writing, indexing, and cluster operations.
- Presents results through structured workflows, examples, and API calls for indexing and searching.
SKILL.md
.github/skills/elasticsearchView on GitHub ↗
---
name: elasticsearch
description: "Guides Elasticsearch usage including index mapping design, query DSL (match, term, bool, aggregations), bulk indexing, cluster management, and performance tuning. Use when the user needs to implement full-text search, design index mappings, write complex search queries, or manage Elasticsearch clusters."
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- Design index mappings with analyzers and field types
- Write search queries (match, term, bool, multi_match, nested, aggregations)
- Index, update, or bulk-load documents via the REST API
- Manage clusters (shards, replicas, snapshots, upgrades)
- Integrate Elasticsearch with Kibana or Logstash (ELK stack)
## How to use this skill
### Workflow
1. **Design the mapping** - Define field types, analyzers, and index settings
2. **Index documents** - Use PUT/POST or bulk API
3. **Write queries** - Use Query DSL with filters for caching
4. **Monitor and tune** - Check cluster health, slow logs, and shard balance
### Quick-Start Example: Create Index and Search
```json
// Create index with mapping
PUT /products
{
"mappings": {
"properties": {
"name": { "type": "text", "analyzer": "standard" },
"description": { "type": "text" },
"price": { "type": "float" },
"category": { "type": "keyword" },
"created_at": { "type": "date" }
}
}
}
// Index a document
POST /products/_doc
{
"name": "Wireless Mouse",
"description": "Ergonomic wireless mouse with USB-C receiver",
"price": 29.99,
"category": "electronics",
"created_at": "2025-01-15"
}
// Search with bool query and aggregation
GET /products/_search
{
"query": {
"bool": {
"must": [{ "match": { "description": "wireless" } }],
"filter": [{ "range": { "price": { "lte": 50 } } }]
}
},
"aggs": {
"by_category": { "terms": { "field": "category" } }
}
}
```
## Best Practices
1. **Define explicit mappings** - Avoid dynamic mapping in production; set `dynamic: strict` to catch errors
2. **Use filters for exact matches** - Filters are cached and faster than queries for keyword/range conditions
3. **Paginate with search_after** - Avoid deep `from`/`size` pagination; use `search_after` for large result sets
4. **Plan shards carefully** - Target 20-40 GB per shard; avoid too many small shards
5. **Snapshot regularly** - Use snapshot/restore for backups; test restore procedures
## Keywords
elasticsearch, search, index, mapping, query DSL, aggregation, 搜索引擎, 全文检索, 聚合, ELK, Kibana, bulk API, cluster
More from partme-ai/full-stack-skills
- adobe-xd"Guides creation of UI/UX designs, interactive prototypes, reusable components, and design specs in Adobe XD. Use when the user asks about Adobe XD artboards, prototype links, repeat grids, component states, design tokens export, or developer handoff."
- angular"Provides comprehensive guidance for Angular framework including components, modules, services, dependency injection, routing, forms, and TypeScript integration. Use when the user asks about Angular, needs to create Angular applications, implement Angular components, or work with Angular features."
- ansible"Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible."
- ant-design-mini"Builds mini-program UIs with Ant Design Mini components for Alipay and WeChat mini-programs. Covers Button, Form, List, Modal, Tabs, NavBar, and 60+ components with theme customization and CSS variable theming. Use when the user needs to create mini-program interfaces with Ant Design Mini, configure themes, or implement mini-program-specific UI patterns."
- ant-design-mobile"Builds React mobile UIs with Ant Design Mobile (antd-mobile) components including Button, Form, List, Modal, Picker, Tabs, PullToRefresh, InfiniteScroll, and 50+ mobile-optimized components. Use when the user needs to create mobile-first React interfaces, implement mobile navigation, forms, or data display with Ant Design Mobile."
- ant-design-react"Builds enterprise React UIs with Ant Design (antd) including 60+ components (Button, Form, Table, Select, Modal, Message), design tokens, TypeScript support, and ConfigProvider theming. Use when the user needs to create React applications with Ant Design, build forms with validation, display data tables, or customize the Ant Design theme."
- ant-design-vueProvides comprehensive guidance for Ant Design Vue (AntDV) component library for Vue 3. Covers installation, usage, API reference, templates, and all component categories. Use when building enterprise-class UI with Vue 3 and Ant Design.
- api-doc-generator"Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention."
- appium"Provides comprehensive guidance for Appium mobile testing including mobile app automation, element location, gestures, and cross-platform testing. Use when the user asks about Appium, needs to test mobile applications, automate mobile apps, or write Appium test scripts."
- ascii-ansi-colorizer"Add an ANSI color layer to existing ASCII/plain-text output (gradient/rainbow/highlights) with alignment-safe rules and a required no-color fallback. Use when the user wants to colorize terminal output, add rainbow effects to CLI text, or style ASCII art with ANSI colors."