<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz" -->

---
title: Stop Using Elasticsearch. Use Postgres Instead. | daily.dev
description: A new open-source Postgres extension called PG text search, built by Tiger Data (the Timescale DB team), brings BM25-based relevance full-text search directly...
canonical: https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Stop Using Elasticsearch. Use Postgres Instead. | daily.dev
og:description: A new open-source Postgres extension called PG text search, built by Tiger Data (the Timescale DB team), brings BM25-based relevance full-text search directly...
og:url: https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz
og:image: https://api.daily.dev/og/posts/rP7USTicZ.png
og:image:alt: Stop Using Elasticsearch. Use Postgres Instead.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Stop Using Elasticsearch. Use Postgres Instead.

**[DevOps Toolbox](https://daily.dev/sources/devopstoolbox)** · 8 min read · 1 upvotes · 0 comments

## Summary

A new open-source Postgres extension called PG text search, built by Tiger Data (the Timescale DB team), brings BM25-based relevance full-text search directly into PostgreSQL. The video demonstrates installing it on PG 18, creating BM25 indexes over document tables, and running scored relevance queries, arguing that most teams using Elasticsearch only need simple text search and could drop it in favor of Postgres plus this extension, while noting exact phrase matching still requires separate SQL conditions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=ehbPURoL41A>

## Questions this post answers

### Can Postgres replace Elasticsearch for full-text search?

For most simple text search use cases, yes. The PG text search extension, built by Tiger Data (the team behind TimescaleDB), brings BM25 relevance ranking directly into PostgreSQL, letting teams that already run Postgres skip standing up a separate Elasticsearch cluster. Elasticsearch remains useful for advanced needs like nested filters, aggregations, vector search, and geospatial queries.

_Comparing Postgres search extensions to Elasticsearch before committing to new infra gets easier with daily.dev._

### How do you install and use the PG text search extension in PostgreSQL 18?

Build it from source (clone, make, install), then start Postgres with the shared_preload_libraries option set to include pg_text_search. After connecting via psql, run CREATE EXTENSION, create a table for documents, and add a BM25 index on the target column, similar to how Elasticsearch builds an index. Queries then use a BM25 operator to score and rank rows by relevance.

_Developers wiring up BM25 search in Postgres can track extension guides like this via daily.dev._

### Why does PostgreSQL sometimes ignore a BM25 index and do a sequential scan instead?

Postgres's query planner chooses a sequential scan over an index when the table is small enough that scanning is cheaper than using the index, as seen with a three-row documents table where EXPLAIN showed a full scan despite a BM25 index existing. This behavior changes once the dataset grows large enough that the index becomes the cheaper option.

_Understanding when Postgres favors scans over indexes helps when tuning search performance, a topic worth following on daily.dev._

## Similar posts on daily.dev

- [Watch Out Elasticsearch\! Tiger Data's PostgreSQL BM25 Search Extension Goes Open Source](https://daily.dev/posts/watch-out-elasticsearch-tiger-data-s-postgresql-bm25-search-extension-goes-open-source-i9m2ohtmp) · It's Foss · 32 upvotes · 0 comments
- [GitHub - timescale/pg\_textsearch: PostgreSQL extension for BM25 relevance-ranked full-text search. Postgres OSS licensed.](https://daily.dev/posts/github---timescale-pg-textsearch-postgresql-extension-for-bm25-relevance-ranked-full-text-search-p-xeiapecnq) · Hacker News · 11 upvotes · 0 comments
- [Better Relevance for AI Apps With BM25 Algorithm in PostgreSQL](https://daily.dev/posts/better-relevance-for-ai-apps-with-bm25-algorithm-in-postgresql-wrgphmk6m) · The New Stack · 1 upvotes · 0 comments
- [textsearch v1.0](https://daily.dev/posts/textsearch-v1-0-horrlwped) · PostgreSQL · 0 upvotes · 0 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql), [#elk](https://daily.dev/tags/elk), [#full-text-search](https://daily.dev/tags/full-text-search)

[View this post on daily.dev](https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Stop Using Elasticsearch. Use Postgres Instead.","url":"https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz"},"datePublished":"2026-08-21T15:21:00.582Z","dateModified":"2026-09-14T06:31:40.219Z","description":"A new open-source Postgres extension called PG text search, built by Tiger Data (the Timescale DB team), brings BM25-based relevance full-text search directly...","image":"https://i.ytimg.com/vi/ehbPURoL41A/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/ehbPURoL41A/sddefault.jpg","isAccessibleForFree":true,"articleSection":"DevOps Toolbox","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DevOps Toolbox","logo":"https://media.daily.dev/image/upload/s--zlfrGvN5--/f_auto/v1752671176/logos/devopstoolbox","url":"https://daily.dev/sources/devopstoolbox"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql,elk,full-text-search","timeRequired":"PT8M","video":{"@type":"VideoObject","name":"Stop Using Elasticsearch. Use Postgres Instead.","description":"A new open-source Postgres extension called PG text search, built by Tiger Data (the Timescale DB team), brings BM25-based relevance full-text search directly...","thumbnailUrl":"https://i.ytimg.com/vi/ehbPURoL41A/sddefault.jpg","uploadDate":"2026-08-21T15:21:00.582Z","duration":"PT8M","url":"https://api.daily.dev/r/rP7USTicZ","embedUrl":"https://www.youtube.com/embed/ehbPURoL41A"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DevOps Toolbox","item":"https://daily.dev/sources/devopstoolbox"},{"@type":"ListItem","position":3,"name":"Stop Using Elasticsearch. Use Postgres Instead."}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/stop-using-elasticsearch-use-postgres-instead--rp7usticz#faq","mainEntity":[{"@type":"Question","name":"Can Postgres replace Elasticsearch for full-text search?","acceptedAnswer":{"@type":"Answer","text":"For most simple text search use cases, yes. The PG text search extension, built by Tiger Data (the team behind TimescaleDB), brings BM25 relevance ranking directly into PostgreSQL, letting teams that already run Postgres skip standing up a separate Elasticsearch cluster. Elasticsearch remains useful for advanced needs like nested filters, aggregations, vector search, and geospatial queries. Comparing Postgres search extensions to Elasticsearch before committing to new infra gets easier with daily.dev."}},{"@type":"Question","name":"How do you install and use the PG text search extension in PostgreSQL 18?","acceptedAnswer":{"@type":"Answer","text":"Build it from source (clone, make, install), then start Postgres with the shared_preload_libraries option set to include pg_text_search. After connecting via psql, run CREATE EXTENSION, create a table for documents, and add a BM25 index on the target column, similar to how Elasticsearch builds an index. Queries then use a BM25 operator to score and rank rows by relevance. Developers wiring up BM25 search in Postgres can track extension guides like this via daily.dev."}},{"@type":"Question","name":"Why does PostgreSQL sometimes ignore a BM25 index and do a sequential scan instead?","acceptedAnswer":{"@type":"Answer","text":"Postgres's query planner chooses a sequential scan over an index when the table is small enough that scanning is cheaper than using the index, as seen with a three-row documents table where EXPLAIN showed a full scan despite a BM25 index existing. This behavior changes once the dataset grows large enough that the index becomes the cheaper option. Understanding when Postgres favors scans over indexes helps when tuning search performance, a topic worth following on daily.dev."}}]}
```

