elasticsearch

Designs and tunes Elasticsearch mappings, queries, relevance, and cluster operations.

22|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/Lynricsy/HyperSkills --skill elasticsearch-lynricsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elasticsearch
Source: https://github.com/Lynricsy/HyperSkills/tree/main/skills/elasticsearch
Command: npx skills add https://github.com/Lynricsy/HyperSkills --skill elasticsearch-lynricsy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Elasticsearch work fails silently: a term query on a text field returns zero hits with no error, a dynamic mapping guess becomes permanent, and a mapping change requires a full reindex. This Skill encodes the verified rules, diagnostic ladders, and gated workflows that prevent those failures and prove every fix with measurement. ## Core Features & Use Cases - Mapping design and review: Access-pattern-to-field-type decision procedure, dynamic mapping traps, multi-fields, flattened objects, and the append-only mapping rule with alias-based reindex cutover. - Query and relevance tuning: Profile-driven slow-query diagnosis, filter-versus-must semantics, judgement-set-based relevance evaluation with _rank_eval, and vector/hybrid search including licence-tier gates. - Cluster operations and diagnostics: Shard-count and heap sizing formulas, allocation-explain reading order, exception-to-cause tables, and honest benchmarking rules. - Use Case: A search endpoint suddenly returns wrong documents after a deploy. Follow the fix-a-query workflow: validate the query, run _analyze on the field, check the mapping for the named sub-fields, and use _explain to name the failing clause before changing anything. ## Quick Start Ask the agent to review your Elasticsearch index mapping and slow search query using the elasticsearch skill, and have it verify each finding against a local 9.5.3 single-node container.

Frequently Asked Questions about elasticsearch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix an Elasticsearch query that returns the wrong documents?

Follow the triage ladder: confirm the document exists with GET /{index}/_doc/{id}, validate the query with _validate/query?explain=true, run _analyze on the field and query text, then use _explain on a document that should have matched. Most cases are term-on-text mismatches or analyzer asymmetry.

How do I change an Elasticsearch mapping on a live index?

Mappings are append-only, so changing an existing field's type or analyzer requires a new index. Create the destination with the corrected mapping, run _reindex with slices auto, verify counts, then swap the alias atomically with one POST /_aliases call.

Why does a term query on a text field return zero hits?

A text field is analyzed into tokens at index time, but a term query is not analyzed, so the exact string never matches the stored tokens. Use match on the text field or term on its .keyword sub-field instead.

Does Elasticsearch hybrid search with RRF work on a basic licence?

No. The rrf and linear retrievers plus the Inference API are Enterprise-tier and return HTTP 403 on a basic licence. On basic, fuse a knn clause and a lexical clause inside bool.should, or do reciprocal-rank fusion in the application.

How many shards should an Elasticsearch index have?

Compute primary shards as max(1, ceil(primary_gb / target_shard_size_gb)) with a 10-50 GB target, never from node count. Budget about 20 shards per GB of heap, with cluster.max_shards_per_node (default 1000) as the hard stop.

Why is my Elasticsearch cluster yellow and is it a problem?

Yellow means a replica shard is unassigned, which is degraded redundancy, not data loss; on a single-node cluster it is the expected state. Use _cluster/allocation/explain and read the decider with decision NO to find the actual cause.