OOmnistu

Blog / Databases

Databases

Postgres full-text search vs Elasticsearch: when to add a search engine

PostgreSQL has real full-text search built in - tsvector, tsquery, dictionaries, ranking, GIN indexes. Elasticsearch is a separate distributed search engine you operate beside your database. What each one's own documentation actually promises, what running a second system costs, and the usage patterns that justify the move - from the PostgreSQL 19 docs and Elastic's own pages, read 21 November 2026.

OOmnistu
Reviewed 2026-11-21 · 4 min read

Per the PostgreSQL 19 documentation and Elastic's own pages, read 21 November 2026: this is not a "which is better" question - it is a "do you need a second system at all" question. Postgres ships genuine full-text search: it parses documents into tokens, normalizes them into lexemes (folding case, removing suffixes and stop words), stores them as tsvector values, matches them with tsquery through the @@ operator, ranks results, and accelerates it all with indexes. Elasticsearch is a separate, distributed search and analytics engine - its own site calls it open source and Lucene-powered - that you run next to your database and feed with your data. The decision hinges on what your search has to do, not on which logo is bigger. No default winner here.

What Postgres full-text search actually gives you

Per chapter 12 of the PostgreSQL 19 docs: full-text search identifies natural-language documents satisfying a query and optionally sorts them by relevance. Documents are parsed into tokens (numbers, words, emails and other classes), tokens are normalized into lexemes by dictionaries, and you can define stop words, map synonyms through Ispell, map phrases through a thesaurus, and stem with Snowball rules. The FTS chapter is equally clear about what plain LIKE and ILIKE lack as search: no linguistic support (searching "satisfy" misses "satisfies") and no result ranking. On speed, be precise: elsewhere the same documentation covers B-tree indexes with pattern operator classes for LIKE and POSIX regular expressions, and the pg_trgm module's GiST and GIN index operator classes that accelerate LIKE, ILIKE and regex searches - so the accurate statement is that plain pattern matching gives you matching without ranking or language handling, not that LIKE can never use an index. Full-text search fixes all three inside the database you already run: a document is just a text field (or a concatenation of fields, even across tables), searching and ranking happen on the tsvector representation, and positional information supports proximity ranking. If you already run Postgres with capacity headroom, the operational bill for all of this is zero new infrastructure.

What Elasticsearch actually is

Per Elastic's own site: Elasticsearch is an open source, distributed search and analytics engine built on Lucene, storing structured, unstructured and vector data, with full-text, fuzzy, semantic and hybrid search, geospatial queries, and analytics over logs and events. It scales "from a laptop to a hundred-node cluster" (their words) with replication and cross-cluster search. Those are vendor claims, but the structural facts are not in dispute: it is a separate system with its own cluster, its own storage, its own query API - and your data must be indexed into it and kept in sync with your database. That sync (change-data-capture, queue, or dual-writes) plus cluster operations is the real price of admission, and it is paid whether your search traffic is ten queries a day or ten million.

The decision is about requirements, not fashion

This part is judgment, grounded in what each side documents. Stay on Postgres FTS when your search is over relational data your database already holds, when you need linguistic matching, ranking and filters (which SQL gives you for free alongside), and when result quality is "good search", not a product in itself. Consider a dedicated engine when search IS the product (a marketplace where ranking quality drives revenue), when you need features core Postgres FTS does not document - vector and hybrid semantic search (note the pgvector extension adds vector search inside Postgres), sophisticated typo tolerance and relevance tuning across many fields, analytics over the same indexed data - or when search load would compete with your transactional workload for database resources. Volume alone is a weak reason: Postgres FTS is indexed, and "slow" is more often a missing GIN index or an unweighted tsvector than a ceiling.

The middle paths nobody mentions

Between "LIKE" and "run an Elasticsearch cluster" sit quieter options. Postgres extensions and lighter engines (the ecosystem offers several) can add specific features - better ranking, typo tolerance - without a distributed cluster. Hosted search services move the operations burden to a vendor at per-record pricing. And pgvector (covered in our embeddings explainer) adds vector search inside Postgres itself. The honest framing: start with the database you have, measure, and add search infrastructure when a documented requirement - not a conference talk - demands it. Adding Elasticsearch "because scale" before you have the load buys you a sync pipeline and a cluster to babysit, not better search.

Sources, all read 21 November 2026: PostgreSQL 19 docs, 12.1 Introduction to Full Text Search (what FTS does; LIKE/ILIKE limitations; tokens, lexemes, dictionaries; stop words, Ispell synonyms, thesaurus, Snowball stemming; tsvector/tsvector-as-document; ranking and positional proximity; index acceleration); PostgreSQL 19 docs, Operator Classes (text/varchar/bpchar pattern opclasses make B-tree indexes usable for LIKE and POSIX regex, character-by-character comparison, C-locale note); PostgreSQL 19 docs, pg_trgm (GiST and GIN index operator classes supporting trigram-based index searches for LIKE, ILIKE, ~, ~* and =); elastic.co, Elasticsearch (open source, distributed search and analytics engine on Lucene; structured/unstructured/vector data; full-text, fuzzy, semantic, hybrid, geospatial; laptop-to-hundred-node-cluster scaling - vendor's own claims).

Deciding your product's search stack? Omnistu's Cloud, Data and DevOps practice works on hosting setup, deployment pipelines, monitoring and data infrastructure - write to team@omnistu.com with what you are deciding.

Frequently asked questions

Does Postgres have real full-text search built in?

Yes. Per the PostgreSQL 19 documentation: it parses documents into tokens, normalizes them into lexemes with configurable dictionaries (stop words, synonyms, thesaurus, stemming), stores them as tsvector, matches with tsquery via the @@ operator, ranks results including proximity ranking, and accelerates searches with indexes.

Why not just use LIKE for search?

As search, plain LIKE and ILIKE have no linguistic support (searching "satisfy" misses "satisfies") and produce no ranked results, per the Postgres FTS chapter. Speed is a separate question: the same documentation covers B-tree pattern operator classes and pg_trgm GiST/GIN indexes that can serve LIKE, ILIKE and regex queries. So: fine for occasional lookups, wrong tool when you need ranking or language-aware matching - "LIKE can never be indexed" is a myth.

When should I add Elasticsearch?

Judgment, not vendor fact: when search is the product and ranking quality drives revenue, when you need features core Postgres FTS does not document (vector/hybrid semantic search - though the pgvector extension adds vectors inside Postgres - heavy relevance tuning, analytics over the same data), or when search load would strain your transactional database. Budget for the sync pipeline and cluster operations - that cost starts on day one.

Is Elasticsearch open source?

Elastic's own site currently calls it "open source", and that is the vendor's claim to verify against its current license page if licensing matters to you. The structural point for this decision does not depend on it: it is a separate distributed system you operate and sync data into.

Can Postgres handle vector or semantic search?

Not in core full-text search - chapter 12 documents lexical matching, not embeddings. The pgvector extension adds vector search inside Postgres (see our embeddings explainer); Elasticsearch documents vector and hybrid search natively. If semantic search is the requirement, that - not keyword quality - is the real fork.

What is the cheapest way to improve slow Postgres search?

Measure first. The docs note full-text searches can be accelerated with indexes (the ecosystem standard is GIN over a tsvector column). A missing index or an unweighted, non-persisted tsvector causes more "Postgres search is slow" stories than any database ceiling does.