Search
Let users find content quickly — from simple filters to full-text and semantic search.
Options
Search Approach*
Search Scope*
Decision Points
Do users search by meaning, not just keywords?
If yes
Invest in semantic/vector search. Start with full-text and migrate.
If no
Full-text search covers keyword use cases at a fraction of the cost.
DB full-text or a dedicated engine (Elasticsearch, Typesense, Algolia)?
If yes
Reach for a dedicated engine when DB FTS can't meet latency or ranking needs. Algolia for hosted DX, Typesense/Meilisearch for self-hosted.
If no
Start with SQLite FTS5 or Postgres tsvector — no extra service to run.
Do users need faceted filtering (refine by category, tag, date range)?
If yes
Use a dedicated engine — faceting across millions of rows in Postgres FTS gets slow fast. Typesense and Algolia do this natively.
If no
Keyword-only over FTS is sufficient; add facets later.
Do you need typo tolerance / fuzzy matching on short queries?
If yes
A dedicated engine (Typesense, Algolia, Meilisearch) gives this out of the box. DB FTS typo tolerance is weak.
If no
Strict matching is fine for structured queries and technical users.
Will you support multiple languages with proper stemming?
If yes
Pick an engine with per-locale analyzers (Elasticsearch, Meilisearch). Postgres tsvector ships only a handful of language dictionaries.
If no
English-only tsvector or FTS5 is plenty.
Do users expect personalized ranking (their clicks influence their results)?
If yes
Algolia or a custom scoring layer on top of an engine — personalization needs per-user signals, not just index weights.
If no
Use global relevance scoring (BM25) — simpler and predictable.
Is autocomplete / instant search (as-you-type) part of the UX?
If yes
Pick Typesense, Algolia, or Meilisearch — all tuned for sub-50ms responses. Postgres FTS will feel sluggish here.
If no
Submit-driven search works against any backend.
Do you need search analytics (popular queries, zero-result queries)?
If yes
Log queries + result counts separately; feed into your analytics pipeline. Algolia and Meilisearch expose this natively.
If no
Skip until product teams ask for it.
Must results respect per-user permissions (ACL-aware)?
If yes
Index ACL identifiers alongside documents and filter at query time. Global cross-entity search is especially risky — validate before shipping.
If no
A flat index is simpler; use when all users see the same corpus.
Do customers need custom synonyms and stop-words (domain vocabulary)?
If yes
A dedicated engine with synonym dictionaries (Algolia, Elasticsearch) — editable without re-indexing.
If no
Default analyzers work for general-purpose text.
Do you need rule-based boosting (featured or sponsored results)?
If yes
Algolia has a dashboard for this; Elasticsearch supports function_score. Don't hand-roll on top of tsvector.
If no
Pure relevance ranking is cleaner.
Is mobile bandwidth a constraint for search-as-you-type?
If yes
Debounce aggressively (~300ms), return tiny payloads, and consider a provider that supports partial-result responses.
If no
Desktop-grade instant search is fine; no special tuning needed.
Must newly created content be searchable within seconds (near-real-time)?
If yes
Index on write into an engine with NRT support (Elasticsearch, Typesense). Budget for higher write amplification.
If no
Batch reindex every few minutes via background job — simpler and cheaper.
Do users search across multiple indices / entity types in one query (federated)?
If yes
Global scope is required. Use Algolia multi-index search or aggregate in app code — plan ranking carefully.
If no
Per-resource search is simpler and faster.
Do users need "did you mean" spell correction for empty-result queries?
If yes
Meilisearch and Algolia provide this out of the box. Ties naturally with zero-result analytics.
If no
Show filters and suggested queries instead; simpler to build.
Should users be able to save searches or get alerts on new matches?
If yes
Store the query, schedule a job to re-run it, and diff results. Pair with the notifications module for delivery.
If no
Manual re-runs cover most use cases; skip the infra.
Tradeoffs
Requires FTS index maintenance; adds write-time overhead
Embedding generation adds latency and API cost per indexed document
Results must be unified and ranked across disparate data models