Search implementation

From rnavarych/alpha-engineer · View interactive version

Search implementation is an AI agent skill from the GitHub repository rnavarych/alpha-engineer. Implement search features using Meilisearch, Typesense, Algolia, ElasticSearch, OpenSearch, or PostgreSQL full-text search. Covers indexing strategy with incremental sync via CDC or application hooks, autocomplete/typeahead with debounce, faceted search UI with URL-encoded filter state, relevance tu

How to use this skill

Skill file

Search Implementation

When to use

Core principles

  1. Engine matches scale and budget — pg_trgm for small datasets with no extra infra; Meilisearch/Typesense for fast typo-tolerant search on a budget; Algolia when managed SaaS and rich UI components justify the cost
  2. Denormalize for search — flatten related data into the search document at index time; joins at query time kill latency
  3. Incremental sync, not full re-index — hook into Prisma middleware, DB triggers, or a CDC pipeline; bulk re-indexing on every change is the first thing that breaks under load
  4. Debounce is not optional — 200-300ms debounce on autocomplete input; without it you hit rate limits and burn the user's battery
  5. Encode filters in the URL — active facets belong in useSearchParams; shareable and bookmarkable search state is a product feature, not a nice-to-have

Reference Files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.