Pular para o conteúdo
Skillpedia
Bancos de dados18 mil · #10675

elasticsearch

O que ela faz

Esta skill orienta o trabalho com o Elasticsearch, incluindo a sintaxe de consultas, mapeamentos de campos, agregações e a saúde do cluster. É para quem cria funções de busca ou analisa logs e dados de séries temporais.

Quando usar

  • ✓Quando você precisa escrever uma consulta de busca ou filtrar resultados no Elasticsearch.
  • ✓Quando você está desenhando mapeamentos de índice antes de carregar dados no Elasticsearch.
  • ✓Quando a saúde do seu cluster mostra amarelo ou vermelho e precisa ser investigada.

Link da skill

https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/elasticsearch/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/elasticsearch/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Escreva uma consulta do Elasticsearch que encontre logs de erro das últimas 24 horas e conte-os por nome de serviço.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

A skill recomenda mapeamentos explícitos, estruturas de consulta claras e agregações, além de passos para verificar a saúde do cluster e o tamanho dos shards.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

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
Perguntas frequentes

Por que definir os mapeamentos eu mesmo?

Depender do mapeamento automático pode causar conflitos de tipos de campo e índices inchados, então a skill recomenda mapeamentos explícitos.

O que significa status amarelo do cluster?

A skill diz que amarelo normalmente indica shards de réplica não alocados, e isso deve ser investigado logo.

Qual a diferença entre campos keyword e text?

Campos keyword buscam valores exatos e permitem ordenação, enquanto campos text são analisados para busca de texto completo.

Detalhes

Descrição original do autor

Elasticsearch expert for queries, mappings, aggregations, index management, and cluster operations

repo: RightNow-AI/openfang

Popularidade

Estrelas no GitHub
18 mil
Posição no ranking
#10675
Licença
Apache-2.0
Atualizada em
02/07/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas