Agent SkillsRightNow-AI/openfang › elasticsearch

elasticsearch

GitHub

Elasticsearch专家技能,提供集群架构、查询DSL、映射设计及性能优化指导。涵盖搜索构建、日志分析管道及时间序列数据平台的生产级最佳实践,包括分片管理、ILM策略和故障排查。

crates/openfang-skills/bundled/elasticsearch/SKILL.md RightNow-AI/openfang

Trigger Scenarios

需要编写或优化Elasticsearch查询语句 设计或调整Elasticsearch索引映射结构 配置Elasticsearch集群运维与生命周期管理

Install

npx skills add RightNow-AI/openfang --skill elasticsearch -g -y
More Options

Non-standard path

npx skills add https://github.com/RightNow-AI/openfang/tree/main/crates/openfang-skills/bundled/elasticsearch -g -y

Use without installing

npx skills use RightNow-AI/openfang@elasticsearch

指定 Agent (Claude Code)

npx skills add RightNow-AI/openfang --skill elasticsearch -a claude-code -g -y

安装 repo 全部 skill

npx skills add RightNow-AI/openfang --all -g -y

预览 repo 内 skill

npx skills add RightNow-AI/openfang --list

SKILL.md

Frontmatter
{
    "name": "elasticsearch",
    "description": "Elasticsearch expert for queries, mappings, aggregations, index management, and cluster operations"
}

Elasticsearch Expert

A search and analytics specialist with deep expertise in Elasticsearch cluster architecture, query DSL, mapping design, and performance optimization. This skill provides production-grade guidance for building search experiences, log analytics pipelines, and time-series data platforms using the Elastic stack.

Key Principles

  • Design mappings explicitly before indexing data; relying on dynamic mapping leads to field type conflicts and bloated indices
  • Understand the difference between keyword fields (exact match, aggregations, sorting) and text fields (full-text search with analyzers)
  • Use index aliases for zero-downtime reindexing, canary deployments, and time-based index rotation
  • Size shards between 10-50 GB for optimal performance; too many small shards waste overhead, too few large shards limit parallelism
  • Monitor cluster health (green/yellow/red) continuously and investigate yellow status immediately, as it indicates unassigned replica shards

Techniques

  • Construct bool queries with must (scored AND), filter (unscored AND), should (OR with minimum_should_match), and must_not (exclusion) clauses
  • Use match queries for full-text search with analyzer-aware tokenization, and term queries for exact keyword lookups without analysis
  • Build aggregations: terms for top-N cardinality, date_histogram for time bucketing, nested for sub-document analysis, and pipeline aggs like cumulative_sum
  • Apply Index Lifecycle Management (ILM) policies with hot/warm/cold/delete phases to automate rollover and data retention
  • Reindex with POST _reindex using source/dest, applying scripts for field transformations during migration
  • Check cluster allocation with GET _cluster/allocation/explain to diagnose why shards remain unassigned
  • Tune search performance with the search profiler API, request caching, and pre-warming for frequently used queries

Common Patterns

  • Search-as-you-type: Use the search_as_you_type field type or edge_ngram tokenizer with a match_phrase_prefix query for autocomplete experiences
  • Parent-Child Relationships: Use join field types for one-to-many relationships where child documents update independently, avoiding costly nested reindexing
  • Cross-cluster Search: Configure remote clusters and use cluster:index syntax to query across multiple Elasticsearch deployments transparently
  • Snapshot and Restore: Register a snapshot repository (S3, GCS, or filesystem) and schedule regular snapshots for disaster recovery with SLM policies

Pitfalls to Avoid

  • Do not use wildcard queries on text fields with leading wildcards, as they bypass the inverted index and cause full field scans
  • Do not index large documents (over 100 MB) without splitting them; they cause memory pressure during indexing and merging
  • Do not set number_of_replicas to 0 in production; replicas provide both search throughput and data redundancy
  • Do not update mappings on existing indices for incompatible type changes; create a new index with the correct mapping and reindex the data

Version History

  • acf2587 Current 2026-08-20 07:38

Same Skill Collection

crates/openfang-hands/bundled/browser/SKILL.md
crates/openfang-hands/bundled/clip/SKILL.md
crates/openfang-hands/bundled/collector/SKILL.md
crates/openfang-hands/bundled/infisical-sync/SKILL.md
crates/openfang-hands/bundled/lead/SKILL.md
crates/openfang-hands/bundled/predictor/SKILL.md
crates/openfang-hands/bundled/researcher/SKILL.md
crates/openfang-hands/bundled/trader/SKILL.md
crates/openfang-hands/bundled/twitter/SKILL.md
crates/openfang-skills/bundled/ansible/SKILL.md
crates/openfang-skills/bundled/api-tester/SKILL.md
crates/openfang-skills/bundled/aws/SKILL.md
crates/openfang-skills/bundled/azure/SKILL.md
crates/openfang-skills/bundled/ci-cd/SKILL.md
crates/openfang-skills/bundled/code-reviewer/SKILL.md
crates/openfang-skills/bundled/compliance/SKILL.md
crates/openfang-skills/bundled/confluence/SKILL.md
crates/openfang-skills/bundled/crypto-expert/SKILL.md
crates/openfang-skills/bundled/css-expert/SKILL.md
crates/openfang-skills/bundled/data-analyst/SKILL.md
crates/openfang-skills/bundled/data-pipeline/SKILL.md
crates/openfang-skills/bundled/docker/SKILL.md
crates/openfang-skills/bundled/email-writer/SKILL.md
crates/openfang-skills/bundled/figma-expert/SKILL.md
crates/openfang-skills/bundled/gcp/SKILL.md
crates/openfang-skills/bundled/git-expert/SKILL.md
crates/openfang-skills/bundled/github/SKILL.md
crates/openfang-skills/bundled/golang-expert/SKILL.md
crates/openfang-skills/bundled/graphql-expert/SKILL.md
crates/openfang-skills/bundled/helm/SKILL.md
crates/openfang-skills/bundled/interview-prep/SKILL.md
crates/openfang-skills/bundled/jira/SKILL.md
crates/openfang-skills/bundled/kubernetes/SKILL.md
crates/openfang-skills/bundled/linear-tools/SKILL.md
crates/openfang-skills/bundled/linux-networking/SKILL.md
crates/openfang-skills/bundled/llm-finetuning/SKILL.md
crates/openfang-skills/bundled/ml-engineer/SKILL.md
crates/openfang-skills/bundled/mongodb/SKILL.md
crates/openfang-skills/bundled/nextjs-expert/SKILL.md
crates/openfang-skills/bundled/nginx/SKILL.md
crates/openfang-skills/bundled/notion/SKILL.md
crates/openfang-skills/bundled/oauth-expert/SKILL.md
crates/openfang-skills/bundled/openapi-expert/SKILL.md
crates/openfang-skills/bundled/postgres-expert/SKILL.md
crates/openfang-skills/bundled/presentation/SKILL.md
crates/openfang-skills/bundled/project-manager/SKILL.md
crates/openfang-skills/bundled/prometheus/SKILL.md
crates/openfang-skills/bundled/prompt-engineer/SKILL.md
crates/openfang-skills/bundled/python-expert/SKILL.md

Metadata

Files
0
Version
acf2587
Hash
09a0b809
Indexed
2026-08-20 07:38

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-21 23:37
浙ICP备14020137号-1 $mapa de visitantes$