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.
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.
Map source database columns to Elasticsearch field types:
text with custom analyzerkeywordinteger, floatbooleandatecompletionCustom 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 suggest field of type completion for typeahead.
searchableAttributes in priority order: ["name", "category", "description"].attributesForFaceting: prefix filterable attributes with filterOnly() for non-displayed facets.customRanking: ["desc(popularity)", "desc(rating)"].minWordSizefor1Typo: 3.updated_at > last_sync_time every 10 seconds, or use database triggers/CDC.Build an endpoint that accepts:
q — full-text query stringcategory, brand, min_price, max_price, rating, in_stocksort — relevance (default), price_asc, price_desc, newest, ratingpage / per_page or cursor-based paginationQuery 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 }
]}}
}
}
Analyze search logs to improve quality:
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" }] }
}
}
}
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'],
});
LIKE does not scale.npx skills add TerminalSkills/search-engine-setup下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer