# pg_textsearch

> PostgreSQL extension for BM25 relevance-ranked full-text search

Source: https://talira.ai/catalog/pg-textsearch-prjz09aa
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Plugin
- Categories: [search / full text](https://talira.ai/categories/search/full-text), [databases / postgres / extensions](https://talira.ai/categories/databases/postgres/extensions)
- Platforms: linux, macos, windows[^1]
- Licence: PostgreSQL[^3]
- Pricing: Free and open source[^3]
- Pricing notes: Free under the PostgreSQL licence; also available on Tiger Cloud.
- Free tier: yes[^3]
- Self-hostable: yes[^1]
- Cloud hosted: yes[^2]
- Backed by: [Tiger Data](https://talira.ai/orgs/tiger-data.md)

pg_textsearch is a [PostgreSQL](https://talira.ai/catalog/postgresql-cm55wcnd.md) extension from Tiger Data (formerly Timescale) that adds a `bm25` index type and an `<@>` operator, so `ORDER BY content <@> 'search terms' LIMIT 10` returns rows ranked by BM25 rather than by `ts_rank`. It uses Postgres's own text search configurations for tokenizing, answers top-k queries with Block-Max WAND, and supports expression, partial and partitioned indexes, parallel builds, replication and `tsquery` Boolean and phrase filters. It's released under the PostgreSQL licence and needs PostgreSQL 17 or newer; pairing it with [pgvector](https://talira.ai/catalog/pgvector-vv3axms1.md) gives hybrid keyword and vector search in one database. It runs on Tiger Cloud and self-hosted Postgres, and Google Cloud offers it in preview on AlloyDB and Cloud SQL.

## Links

- GitHub: https://github.com/timescale/pg_textsearch
- Docs: https://www.tigerdata.com/docs/learn/search/using-pg-textsearch

## Problems it solves

- rank Postgres full-text search results by BM25 instead of ts_rank
- add keyword search next to pgvector embeddings so I can fuse both rankings for hybrid retrieval
- fast top-10 keyword search in Postgres without scoring every row that matches
- BM25 index over a JSONB field or several text columns in Postgres
- relevance-ranked keyword search in Postgres under a permissive licence I can ship to customers
- good search relevance without running a separate search cluster next to our Postgres database
- one keyword index per language for a multilingual documents table in Postgres
- Chinese full-text search ranked by relevance in Postgres

## Features

- bm25 index access method with configurable k1 and b
- `<@>` operator for ranked ORDER BY ... LIMIT queries, and to_bm25query() to name the index
- uses PostgreSQL text search configurations, including Chinese through zhparser
- Block-Max WAND for fast top-k queries
- expression, partial and partitioned indexes, including JSONB fields and text arrays
- Boolean and phrase filtering with tsquery (&, |, !, <->, prefix matching)
- parallel index builds, segment compression and background compaction (with pg_durable)
- physical replication and hot standby support
- prebuilt packages for Linux amd64 and arm64; builds from source on macOS and Windows

## Limitations

- Doesn't run on PostgreSQL 16 or older: it supports PostgreSQL 17, 18 and the 19 release candidate[^1]
- Doesn't give scores you can compare across partitions: BM25 statistics are kept per partition of a partitioned table[^1]
- Doesn't have built-in faceted search[^2]
- Doesn't index TimescaleDB compressed chunks or compressed table data[^2]

## Trust

Overall: 0.27 out of 1.
Signals: backing 0.30, extensibility 0.00.

- backed by Tiger Data

Warnings:

- GitHub activity not fetched yet

## Related

- Works with [PostgreSQL](https://talira.ai/catalog/postgresql-cm55wcnd.md)
- Works with [pgvector](https://talira.ai/catalog/pgvector-vv3axms1.md)

## Alternatives

- [ParadeDB](https://talira.ai/catalog/paradedb-95q504ea.md): Postgres for full-text search, vector retrieval and aggregations, as an extension (pg_search)
- [Elasticsearch](https://talira.ai/catalog/elasticsearch-5kvt1ns8.md): Open source search, analytics, and AI platform
- [VectorChord-bm25](https://talira.ai/catalog/vectorchord-bm25-rxf61772.md): Native BM25 ranking index in PostgreSQL
- [Manticore Search](https://talira.ai/catalog/manticore-search-np1eg4hm.md): Fast open source search database for full-text, vector and hybrid search, an Elasticsearch alternative
- [Apache Lucene](https://talira.ai/catalog/apache-lucene-jesby69k.md): A high-performance, full-featured text search engine library written in Java
- [Tantivy](https://talira.ai/catalog/tantivy-0cr40qwa.md): Fast full-text search engine library written in Rust

## Sources

[^1]: https://github.com/timescale/pg_textsearch (checked 20 Nov 2026)
[^2]: https://www.tigerdata.com/docs/deploy/tiger-cloud/tiger-cloud-extensions/pg-textsearch (checked 20 Nov 2026)
[^3]: https://github.com/timescale/pg_textsearch/blob/main/LICENSE (checked 20 Nov 2026)
