Product Full-Text Search
lobehub/lobehub
Guides work on LobeHub's own product search: the shared search repository, provider choice, Elasticsearch mappings, change syncing and reindexing.
Improve Elasticsearch search relevance for content and catalog indices: pin or promote results with query rules (correct rule type, criteria, and rule-query wiring) and tune organic ranking with…
$ npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install elastic/agent-skills elasticsearch-search-relevance --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-search-relevance .claude/skills/elasticsearch-search-relevance && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "elasticsearch-search-relevance" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-search-relevance into .claude/skills/elasticsearch-search-relevance/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-search-relevance", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-search-relevanceType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install elastic/agent-skills elasticsearch-search-relevance --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-search-relevance .agents/skills/elasticsearch-search-relevance && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "elasticsearch-search-relevance" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-search-relevance into .agents/skills/elasticsearch-search-relevance/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-search-relevance", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install elastic/agent-skills elasticsearch-search-relevance --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-search-relevance .cursor/skills/elasticsearch-search-relevance && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "elasticsearch-search-relevance" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-search-relevance into .cursor/skills/elasticsearch-search-relevance/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-search-relevance", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/elastic/agent-skills.git --path skills/elasticsearch/elasticsearch-search-relevance--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install elastic/agent-skills elasticsearch-search-relevance --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-search-relevance .gemini/skills/elasticsearch-search-relevance && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "elasticsearch-search-relevance" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-search-relevance into .gemini/skills/elasticsearch-search-relevance/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-search-relevance", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install elastic/agent-skills elasticsearch-search-relevanceInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-search-relevance .github/skills/elasticsearch-search-relevance && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "elasticsearch-search-relevance" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-search-relevance into .github/skills/elasticsearch-search-relevance/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-search-relevance", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install elastic/agent-skills elasticsearch-search-relevance --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/elastic/agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/elasticsearch/elasticsearch-search-relevance .opencode/skills/elasticsearch-search-relevance && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "elasticsearch-search-relevance" agent skill from https://github.com/elastic/agent-skills/tree/main/skills/elasticsearch/elasticsearch-search-relevance into .opencode/skills/elasticsearch-search-relevance/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "elasticsearch-search-relevance", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
elasticsearch-search-relevanceImprove Elasticsearch search relevance for content and catalog indices: pin or promote results with query rules (correct rule type, criteria, and rule-query wiring) and tune organic ranking with…
Elasticsearch Search Relevance is an agent skill from elastic/agent-skills, published by the product's own GitHub organization. Improve Elasticsearch search relevance for content and catalog indices: pin or promote results with query rules (correct rule type, criteria, and rule-query wiring) and tune organic ranking with multimatch, field boosts, and analysis grounded in the index mapping. Use when search results rank poorly, a specific document must appear first for a query, or the user asks to tune full-text matching — not for ES|QL analytics, index ingest, or cluster health.
Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/multi-match-tuning.md` and `references/query-rules-reference.md`). Compatibility notes: Elasticsearch 8.10 or later (query rules), self-managed, Elastic Cloud Hosted, or Elastic Cloud Serverless. Requires the elastic CLI ≥ 0.2 with stack es…
It sits in Backend & APIs, covering Search implementation. It works with Elasticsearch. The repository describes itself as: Official Elastic Skills. The licence is Apache-2.0.
4 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit baa5111. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are json).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Elasticsearch 8.10 or later (query rules), self-managed, Elastic Cloud Hosted, or Elastic Cloud Serverless. Requires the `elastic` CLI ≥ 0.2 with `stack es` support.
From compatibility in the SKILL.md frontmatter.
Elasticsearch Search Relevance loads about 3.2k tokens when it runs, and up to ~5.3k if it reads all its reference files. Until then it costs about 122 tokens; SKILL.md has 1,285 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from elastic/agent-skills at commit baa5111, republished under its Apache-2.0 licence (© elastic). 1,285 words, ~3,248 tokens.
.claude/skills/elasticsearch-search-relevance/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Improve full-text search results on content and catalog indices. Diagnose the mapping and current query, choose the right relevance lever (query rules for deterministic pinning vs multi_match and field boosts for organic ranking), apply the change, and verify top hits before reporting success.
<!-- begin-partial: preamble -->
This skill executes Elasticsearch operations through the elastic CLI. If the
elastic CLI is not installed, tell the user what it is needed for. Do
not guess credentials, call the HTTP API directly, or attempt other workarounds.
This skill references operations in HTTP-shorthand form (e.g., GET /, GET /_cat/indices, GET /{index}/_mapping,
GET /{index}/_settings/index.mode, POST /_query). The Operations table at the end of this document
maps each shorthand to the equivalent elastic CLI command — always use the CLI rather than calling the HTTP API
directly.
<!-- end-partial: preamble -->
This skill covers Query DSL relevance on indices with text (and optional keyword) fields — product catalogs,
documentation, knowledge bases. It uses POST /{index}/_search for evaluation and query-rules APIs for pinned or
excluded documents.
Out of scope:
POST /_query) — use the elasticsearch-esql skill.| User intent | Lever | APIs |
|---|---|---|
| Always show document X first for query Q | Query rules — pinned rule + rule query in search | PUT /_query_rules/{ruleset_id}, POST /{index}/_search |
| Hide specific documents for query Q | Query rules — exclude rule + rule query | Same |
| Better ranking for open-ended text queries | multi_match across mapped text fields with field boosts | POST /{index}/_search |
| Tokens not matching user language | Operator, minimum_should_match, or synonym analyzers | POST /{index}/_search, optionally POST /{index}/_analyze |
Decision rule: If the user names a document that must rank first for a specific query, use query rules. If results
are generally weak for a phrase, tune the organic query from the mapping. Do not simulate pinning with extreme boosts,
function_score, or sort clauses.
Inspect the mapping and current query. Call GET / to confirm connectivity. When the index is unknown, narrow
candidates with GET /_cat/indices, then call GET /{index}/_mapping.
From the mapping, list every text field (e.g., title, description) and every keyword field used for filters
(brand, category). Note which fields are short (precision) vs long (recall). Read the user's current search body
if provided — identify which fields it queries and whether it already uses rule, multi_match, or single-field
match.
Decision: Is the problem deterministic promotion (one doc must win for one query) or organic ranking (several docs should score better)? Data needed: index name, mapping properties, current query JSON, example query strings, and target document ID(s) when pinning.
Choose the relevance lever. Apply the decision from step 1:
Pinning / promotion → Create a query-rules ruleset with a rule of type pinned (never exclude for
promotion). Set criteria so the rule fires only for the intended query text — e.g., contains or exact on a
metadata key such as query_string with value "sale". Set actions to pin the correct document via ids (e.g.,
["SKU123"]) or docs (e.g., [{"_index":"catalog","_id":"SKU123"}]). Use docs when _id may not be unique
across indices. Read Query Rules Reference for full structure.
Organic ranking → Replace single-field match on a long field with multi_match across the mapped text
fields. Boost short fields (typically title^2 with description unboosted). Consider operator,
minimum_should_match, or synonym-aware analyzers when multi-word recall is still poor — but do not sort by
price, date, or keyword fields to fake better text relevance, and do not query .keyword sub-fields with
term for analyzed user phrases. Read Multi-Match Tuning.
Decision: Pick exactly one primary lever per request. Data needed: chosen fields and boosts, ruleset ID and rule ID names, criteria metadata keys, and pinned document identifiers.
Apply the change. Execute the APIs for the chosen lever:
Query rules path
PUT /_query_rules/{ruleset_id} (or add one rule with
PUT /_query_rules/{ruleset_id}/_rule/{rule_id}).GET /_query_rules/{ruleset_id}.POST /_query_rules/{ruleset_id}/_test using the same match_criteria you will pass at
search time.POST /{index}/_search must use a rule query whose ruleset_id references the ruleset and
whose match_criteria supplies values for every criteria metadata key (e.g., "query_string": "sale"). Place
the normal relevance clause inside organic. Creating the ruleset alone does not pin anything — the pin
applies only when search includes the rule query.Organic tuning path
multi_match (or equivalent bool/should) query from the mapping.POST /{index}/_analyze on sample query text when tokenization explains misses.Decision: Stop after one coherent change set; avoid stacking unrelated edits before testing.
Test and compare top hits. Before and after each candidate, call POST /{index}/_search with the same size (≥
10), the user's query string, and "track_scores": true. For pinning, the search body must include the rule
query from step 3.
Compare for each run:
_id values and order_score where relevant_source fields (title, description, product id)For pinning, confirm the target document (e.g., SKU123) is first when match_criteria matches the query and
that organic matches still appear below. For organic tuning, confirm titles and intent-aligned documents rise without
relying on sort or keyword exact-match hacks.
Decision: Ship the candidate that wins on evidence; if none improve results, report what was tried and propose the next lever (e.g., synonyms or additional fields). Data needed: side-by-side top-hit lists from baseline and candidate queries.
catalogWrong: Boost SKU123, sort by _id, or create a ruleset without a rule search query.
Right:
PUT /_query_rules/catalog-sale-pin with a pinned rule, criteria matching query text "sale", actions pinning
SKU123.POST /catalog/_search with:{
"query": {
"rule": {
"ruleset_id": "catalog-sale-pin",
"match_criteria": { "query_string": "sale" },
"organic": {
"multi_match": {
"query": "sale",
"fields": ["title^2", "description"]
}
}
}
},
"size": 10
}Verify SKU123 is hit #1 and remaining hits are organic matches below the pin.
description is searchedMapping provides title and description as text, plus brand and category as keyword.
Wrong: Keep match on description only; sort by price; term query on title.keyword.
Right:
POST /catalog/_search with the user's current match on description; record top hits.POST /catalog/_search with:{
"query": {
"multi_match": {
"query": "running shoes",
"fields": ["title^2", "description"],
"type": "best_fields",
"operator": "or",
"minimum_should_match": "75%"
}
},
"size": 10
}title should rank above description-only matches. If recall is
still thin, consider synonym expansion in a follow-up iteration (not sort-by-price).name, content, or body without checking
GET /{index}/_mapping.metadata keys in rule criteria must appear in the search
rule.match_criteria object with the runtime values (typically the user's query string).keyword fields in filter context, not as the primary full-text
target for natural language.pinned actions, ruleset JSON, rule
query wiring, test API| HTTP API (shorthand) | elastic CLI command |
|---|---|
GET / | elastic es info |
GET /_cat/indices | elastic es cat indices --index '<pattern>' |
GET /{index}/_mapping | elastic es indices get-mapping --index '<index>' |
PUT /_query_rules/{ruleset_id} | elastic es query-rules put-ruleset --ruleset-id '<id>' --rules '<json>' |
PUT /_query_rules/{ruleset_id}/_rule/{rule_id} | elastic es query-rules put-rule --ruleset-id '<id>' --rule-id '<id>' --type pinned --criteria '<json>' --actions '<json>' |
GET /_query_rules/{ruleset_id} | elastic es query-rules get-ruleset --ruleset-id '<id>' |
POST /_query_rules/{ruleset_id}/_test | elastic es query-rules test --ruleset-id '<id>' --match-criteria '<json>' |
POST /{index}/_search | elastic es search --index '<index>' --query '<json>' |
POST /{index}/_analyze | elastic es indices analyze --index '<index>' --field '<field>' --text '<text>' |
© elastic, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in skills/elasticsearch/elasticsearch-search-relevance of elastic/agent-skills.
Open the folder on GitHubat commit baa5111
Elasticsearch Search Relevance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Elasticsearch Search Relevance this skillelastic/agent-skills | 592 | — | ~3.2k | Automated safety check: Pass | Apache-2.0 | |
| Product Full-Text Searchlobehub/lobehub | 83k | — | ~4.1k | Automated safety check: Pass | Custom licence | |
| Foundatio Repositoriesexceptionless/Exceptionless | 2.5k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Elasticsearch Authnaspectrr/deer | 405 | — | ~1.2k | Automated safety check: Notes | MIT | |
| Elasticsearch Authzaspectrr/deer | 405 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Elasticsearch File Ingestaspectrr/deer | 405 | — | ~684 | Automated safety check: Pass | MIT |
lobehub/lobehub
Guides work on LobeHub's own product search: the shared search repository, provider choice, Elasticsearch mappings, change syncing and reindexing.
exceptionless/Exceptionless
Query, aggregate, patch, or paginate Exceptionless data through its Elasticsearch repository abstractions.
aspectrr/deer
Authenticate to Elasticsearch using native, file-based, LDAP/AD, SAML, OIDC, Kerberos, JWT, or certificate realms.
aspectrr/deer
Manage Elasticsearch RBAC: native users, roles, role mappings, document- and field-level security.
aspectrr/deer
Ingest and transform data files (CSV/JSON/Parquet/Arrow IPC) into Elasticsearch with stream processing and custom transforms.
aspectrr/deer
Diagnose and resolve Elasticsearch security errors: 401/403 failures, TLS problems, expired API keys, role mapping mismatches, and Kibana login issues.
elastic/agent-skills
Triage Elastic Security alerts — gather context, classify threats, create cases, and acknowledge.
elastic/agent-skills
Create, search, update, and manage SOC cases via the Kibana Cases API.
elastic/agent-skills
Create, tune, and manage Elastic Security detection rules (SIEM and Endpoint).
elastic/agent-skills
Create and manage Kibana Dashboards and Lens visualizations.
elastic/agent-skills
Generate sample security events, attack scenarios, and synthetic alerts for Elastic Security.
elastic/agent-skills
Onboard an Elastic Cloud organization: configure the elastic CLI's Cloud context and API key, establish a default region, then invite users, assign predefined or custom Serverless project roles, and…
Works with
Categories
Improve Elasticsearch search relevance for content and catalog indices: pin or promote results with query rules (correct rule type, criteria, and rule-query wiring) and tune organic ranking with…. Elasticsearch Search Relevance is an agent skill from elastic/agent-skills, published by the product's own GitHub organization. Improve Elasticsearch search relevance for content and catalog indices: pin or promote results with query rules (correct rule type, criteria, and rule-query wiring) and tune organic ranking with multimatch, field boosts, and analysis grounded in the index mapping.
Elasticsearch Search Relevance fits situations like: search results rank poorly; A specific document must appear first for a query; the user asks to tune full-text matching — not for ES|QL analytics.
Run `npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a claude-code`. Or copy the skill folder (skills/elasticsearch/elasticsearch-search-relevance in elastic/agent-skills) into .claude/skills/elasticsearch-search-relevance in your project. Claude Code loads it when a task matches its description.
Run `npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a codex`. Or copy the skill folder (skills/elasticsearch/elasticsearch-search-relevance in elastic/agent-skills) into .agents/skills/elasticsearch-search-relevance in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add elastic/agent-skills --skill elasticsearch-search-relevance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/elasticsearch-search-relevance, .gemini/skills/elasticsearch-search-relevance, .github/skills/elasticsearch-search-relevance and .opencode/skills/elasticsearch-search-relevance in your project.
SKILL.md names no scripts, command-line tools or credentials: Elasticsearch Search Relevance is instructions for the agent only. Compatibility (from SKILL.md): Elasticsearch 8.10 or later (query rules), self-managed, Elastic Cloud Hosted, or Elastic Cloud Serverless. Requires the `elastic` CLI ≥ 0.2 with `stack es` support..
SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Elasticsearch Search Relevance is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Elasticsearch Search Relevance: Product Full-Text Search (lobehub/lobehub, 83k stars), Foundatio Repositories (exceptionless/Exceptionless, 2.5k stars), Elasticsearch Authn (aspectrr/deer, 405 stars) and Elasticsearch Authz (aspectrr/deer, 405 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
elastic (a GitHub organization, an official publisher) maintains it in elastic/agent-skills, which has 592 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 7, 2026.
Source: elastic/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.