search-engine-setup
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "search-engine-setup":https://skillpi.com/zh/skills/deepskill-259af70d9cd6406b31fa17812249798dea4ae7967b0e485006cf43e4e5d61aa3。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
为应用程序设置和优化搜索引擎,覆盖索引设计、数据同步、搜索 API、自动补全、相关性调优和查询分析。适用于添加搜索功能、设置 Elasticsearch 或配置 Algolia、实现模糊搜索、分面筛选以及修复搜索相关性问题。
介绍来源: third_party · TerminalSkills · 1.0.0 参考来源
SkillPi 解读
- 实测状态
- 未测试
文件浏览
Frontmatter
name: search-engine-setup
description: >-
Set up and optimize search engines for applications. Use when someone asks to
"add search to my app", "set up Elasticsearch", "configure Algolia",
"fix search relevance", "add autocomplete", "fuzzy search", or "faceted
filtering". Covers index design, data sync, search API, autocomplete,
relevance tuning, and query analysis.
license: Apache-2.0
compatibility: "Elasticsearch 8.x or Algolia. Node.js/Python examples provided."
metadata:
author: terminal-skills
version: "1.0.0"
category: development
tags: ["search", "elasticsearch", "algolia", "full-text-search"]Search Engine Setup
Overview
This skill helps AI agents implement production-quality search in applications. It covers index design with custom analyzers, database-to-index sync pipelines, search APIs with faceting and highlights, autocomplete, and relevance tuning based on real query data.
Instructions
Index Design (Elasticsearch)
-
Map source database columns to Elasticsearch field types:
- Text columns users search →
textwith custom analyzer - Enum/category columns for filtering →
keyword - Numeric columns for range filters →
integer,float - Boolean flags →
boolean - Dates →
date - Fields for autocomplete →
completion
- Text columns users search →
-
Custom analyzer template for product/content search:
{ "analyzer": { "content_analyzer": { "tokenizer": "standard", "filter": ["lowercase", "synonym_filter", "edge_ngram_filter"] } }, "filter": { "synonym_filter": { "type": "synonym", "synonyms_path": "synonyms.txt" }, "edge_ngram_filter": { "type": "edge_ngram", "min_gram": 3, "max_gram": 15 } } } -
Boost fields by search importance: title/name (3-5x), tags (2x), description (1x).
-
Always add a
suggestfield of typecompletionfor typeahead.
Index Design (Algolia)
- Set
searchableAttributesin priority order:["name", "category", "description"]. - Set
attributesForFaceting: prefix filterable attributes withfilterOnly()for non-displayed facets. - Configure
customRanking:["desc(popularity)", "desc(rating)"]. - Enable typo tolerance (on by default) and set
minWordSizefor1Typo: 3.
Sync Pipeline
- Full re-index: On first run or manual trigger, paginate through all source records (1000 per batch), transform to index documents, bulk insert.
- Incremental sync: Poll
updated_at > last_sync_timeevery 10 seconds, or use database triggers/CDC. - Deletions: Track soft-deleted records. Remove from index when detected.
- Idempotency: Use source record ID as document ID. Upsert, never blind insert.
- Error handling: Log failed documents, continue batch. Retry failures in next cycle.
Search API
Build an endpoint that accepts:
q— full-text query string- Filter params —
category,brand,min_price,max_price,rating,in_stock sort—relevance(default),price_asc,price_desc,newest,ratingpage/per_pageor cursor-based pagination
Query construction (Elasticsearch):
{
"query": {
"bool": {
"must": [{ "multi_match": { "query": "q", "fields": ["name^5", "description"], "fuzziness": "AUTO" }}],
"filter": [
{ "term": { "category": "electronics" }},
{ "range": { "price_cents": { "gte": 2000, "lte": 10000 }}},
{ "term": { "in_stock": true }}
],
"should": [{ "term": { "in_stock": { "value": true, "boost": 2 }}}]
}
},
"highlight": { "fields": { "name": {}, "description": {} }},
"aggs": {
"categories": { "terms": { "field": "category", "size": 20 }},
"brands": { "terms": { "field": "brand", "size": 20 }},
"price_ranges": { "range": { "field": "price_cents", "ranges": [
{ "to": 2500 }, { "from": 2500, "to": 10000 }, { "from": 10000 }
]}}
}
}
Autocomplete
- Use completion suggester for prefix-based typeahead (fastest).
- Return top 5 suggestions with category context.
- Add "did you mean" using phrase suggester for low-result queries.
Relevance Tuning
Analyze search logs to improve quality:
- Zero-result queries: Check for misspellings → add synonyms. Check for missing data → flag content gaps.
- Low CTR queries: Top results don't match intent → adjust boost weights or add synonyms.
- Position bias: If users consistently click result #3+, the ranking formula needs tuning.
- Apply changes iteratively: synonyms first, then boost adjustments, then custom scoring.
Examples
Example 1 — Blog search index
Input: "Set up search for a blog with 10K articles."
Output:
{
"mappings": {
"properties": {
"title": { "type": "text", "analyzer": "content_analyzer", "boost": 5.0 },
"body": { "type": "text", "analyzer": "content_analyzer" },
"author": { "type": "keyword" },
"tags": { "type": "keyword" },
"published_at": { "type": "date" },
"suggest": { "type": "completion", "contexts": [{ "name": "tag", "type": "category" }] }
}
}
}
Example 2 — Algolia configuration for an e-commerce store
Input: "Configure Algolia for a store with products."
Output:
index.setSettings({
searchableAttributes: ['name', 'brand', 'category', 'description'],
attributesForFaceting: ['category', 'brand', 'filterOnly(price_cents)', 'rating'],
customRanking: ['desc(sales_count)', 'desc(rating)'],
typoTolerance: true,
minWordSizefor1Typo: 3,
minWordSizefor2Typos: 6,
hitsPerPage: 20,
snippetEllipsisText: '…',
attributesToSnippet: ['description:30'],
});
Guidelines
- Start with Elasticsearch for control, Algolia for speed-to-market. Elasticsearch gives full tuning power; Algolia is faster to set up but costs more at scale.
- Never search the primary database. Always sync to a dedicated search index. SQL
LIKEdoes not scale. - Fuzziness AUTO is almost always correct. It allows 1 typo for 3-5 char words and 2 typos for 6+ chars.
- Synonyms are the highest-ROI tuning. Most zero-result queries are fixed by adding 10-20 synonym pairs.
- Monitor query performance. Set an alert if p95 search latency exceeds 200ms.
当前收录版本
1.0.0
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 覆盖完整的生产级搜索引擎实现流程,从索引设计到相关性调优
- 提供Elasticsearch和Algolia双方案,满足不同场景需求
- 包含真实业务场景示例(博客搜索、电商配置)
亮点
- 触发词覆盖全面,包含多种搜索相关需求变体
- description清晰界定适用场景,边界明确
亮点
- Phase/步骤清晰,包含索引设计、同步管道、搜索API等完整流程
- 提供端到端示例,frontmatter完整规范
- 代码示例丰富,包含JSON配置和JavaScript实现
亮点
- 工具来源明确(Elasticsearch/Algolia),参数配置正确
- 覆盖主要异常处理(错误处理、重试机制、幂等性)
- 提供性能监控建议(p95延迟告警)
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。