Adding search to your application is one of those decisions where the wrong choice costs months of rework. Elasticsearch dominates the enterprise, Meilisearch has emerged as the developer-friendly alternative, and PostgreSQL's built-in full-text search covers surprisingly many use cases. This comparison helps you pick the right search solution for your scale and requirements.

Quick Comparison

FeatureElasticsearchMeilisearchPostgreSQL FTSTypesense
TypeDistributed search engineEmbedded search engineDatabase built-inEmbedded search engine
LanguageJavaRustC (PostgreSQL)C++
Setup ComplexityHigh (JVM tuning, cluster management)Very Low (single binary, zero config)None (already in PostgreSQL)Very Low (single binary)
Typo ToleranceFuzzy queries (configurable)Built-in, excellent (default)None (pg_trgm extension for trigram)Built-in, excellent (default)
Faceted SearchExcellent (aggregations)Good (filters + facets)Manual (COUNT + GROUP BY)Good (filters + facets)
Relevance TuningVery High (BM25, custom scoring, boost)Good (ranking rules, customizable)Limited (ts_rank, ts_rank_cd)Good (ranking rules)
Indexing Speed~10K docs/sec~100K docs/sec~5K docs/sec~150K docs/sec
Query Latency10-100ms1-10ms5-50ms1-5ms
Max ScaleBillions of documentsMillions of documentsMillions (depends on hardware)Millions of documents
Operational CostHigh (dedicated cluster)Low (single server)None (same DB server)Low (single server)
Best ForEnterprise, log analytics, massive scaleSaaS apps, developer-friendly searchSimple search, when you only have PostgreSQLSaaS apps, instant search experiences

When to Use What

ScenarioRecommended SolutionWhy
You just need basic keyword search in one tablePostgreSQL FTSNo new infrastructure, good enough for most simple searches
SaaS app, need typo-tolerant search, faceted filteringMeilisearch or TypesenseExcellent developer experience, minimal ops, fast
Log analytics, SIEM, massive text corpus (1B+ docs)ElasticsearchOnly option that scales to billions with aggregation
E-commerce product search with facetsMeilisearch or TypesenseBuilt-in facets, typo tolerance, instant search
You already run Elasticsearch for logging (ELK stack)ElasticsearchUse existing infrastructure, operational expertise already present
Minimum operational overhead, small teamMeilisearchSingle binary, zero config, auto-indexing

PostgreSQL Full-Text Search: Getting Started

-- Enable FTS with a generated column + index
ALTER TABLE articles ADD COLUMN search_vector tsvector
  GENERATED ALWAYS AS (
    setweight(to_tsvector('english', coalesce(title, '')), 'A') ||
    setweight(to_tsvector('english', coalesce(body, '')), 'B')
  ) STORED;

CREATE INDEX articles_search_idx ON articles USING GIN (search_vector);

-- Search with ranking
SELECT title, ts_rank(search_vector, query) AS rank
FROM articles, to_tsquery('english', 'postgresql & performance') query
WHERE search_vector @@ query
ORDER BY rank DESC
LIMIT 20;

-- Limitations to know:
-- No typo tolerance (use pg_trgm for fuzzy matching)
-- No faceted search (implement with COUNT + GROUP BY)
-- Relevance tuning is basic compared to dedicated search engines

Meilisearch vs Typesense: Head-to-Head

FeatureMeilisearchTypesense
API StyleREST, intuitiveREST, intuitive
Typo ToleranceExcellent, automaticExcellent, automatic
Indexing Speed~100K docs/sec~150K docs/sec
Memory UsageHigher (requires more RAM)Lower (more memory efficient)
Client Libraries35+ official SDKs20+ official SDKs
Self-HostedFree (open source)Free (open source)
CloudMeilisearch CloudTypesense Cloud
Best ForDeveloper happiness, rapid integrationInstant search (sub-10ms), high throughput

Bottom line: Start with PostgreSQL FTS if you only need basic keyword search — it is free, already running, and handles 80% of use cases. Move to Meilisearch or Typesense when you need typo tolerance, faceted search, or instant-search UX. Only reach for Elasticsearch when you have a dedicated ops team and need to scale to billions of documents or complex aggregations. See also: PostgreSQL Query Optimization and PostgreSQL vs MySQL vs SQLite.