Zum Inhalt springen
Skillpedia
Datenbanken18k · #10675

elasticsearch

Was er macht

Dieser Skill führt durch die Arbeit mit Elasticsearch, einschließlich Abfragesyntax, Feld-Mappings, Aggregationen und Clusterzustand. Er ist für Menschen gedacht, die Suchfunktionen bauen oder Logs und Zeitreihen auswerten.

Wann du ihn nutzt

  • ✓Wenn du eine Suchabfrage schreiben oder Ergebnisse in Elasticsearch filtern musst.
  • ✓Wenn du Index-Mappings entwirfst, bevor du Daten in Elasticsearch lädst.
  • ✓Wenn dein Cluster den Zustand Gelb oder Rot zeigt und untersucht werden muss.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/elasticsearch/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Schreibe eine Elasticsearch-Abfrage, die Fehler-Logs der letzten 24 Stunden findet und sie nach Dienstname zählt.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill empfiehlt explizite Mappings, klare Abfragestrukturen und Aggregationen, dazu Schritte zur Prüfung des Clusterzustands und der Shard-Größen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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
Häufige Fragen

Warum Mappings selbst festlegen?

Automatische Mappings können zu Konflikten bei Feldtypen und aufgeblähten Indizes führen. Deshalb empfiehlt der Skill explizite Mappings.

Was bedeutet der Status Gelb?

Laut Skill heißt Gelb meist, dass Replikat-Shards nicht zugewiesen sind. Das sollte sofort untersucht werden.

Worin unterscheiden sich keyword- und text-Felder?

Keyword-Felder vergleichen exakte Werte und unterstützen Sortierung, Text-Felder werden für die Volltextsuche analysiert.

Details

Originalbeschreibung des Autors

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

repo: RightNow-AI/openfang

Beliebtheit

GitHub-Sterne
18k
Platz im Ranking
#10675
Lizenz
Apache-2.0
Aktualisiert
2.7.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills