search-engine-setup
БесплатноБез исполняемых скриптовНе проверенSets up and optimizes search engines for applications. Use when someone asks to "add search to my app", "set up Elasticsearch", "configure Algolia", "fix…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
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 at query time, not in the mapping:
fields: ["title^5", "tags^2", "description"]in themulti_match(title/name 3-5x, tags 2x, description 1x).Always add a
suggestfield of typecompletionfor typeahead.Use the
edge_ngramfilter only in the index-time analyzer. Give fields asearch_analyzerwithout it (lowercase and synonyms only). If the query side is also edge-n-grammed, a short query likeheamatches every word starting with those letters and relevance falls apart.
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": "wireless headphones", "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" },
"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: "Configu
Установить search-engine-setup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл search-engine-setup?
Sets up and optimizes 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.
Как установить скилл search-engine-setup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл search-engine-setup запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic