Our take
Activeregular commits and releases- Activity
- 69
- Community
- 41
- Issues
- 64
- Pull requests
- 58
+30 stars in the last 30 days
- Merges more pull requests than 82% of the projects we track
- Releases more often than 75% of the projects we track
pg_textsearch is an actively maintained PostgreSQL-native BM25 extension with useful ranking and indexing capabilities, but its development is concentrated among a small number of contributors.
Good fit if
- Your data and application already use PostgreSQL 17 or 18, and you want BM25-ranked results within that database.
- You need PostgreSQL text configurations, Boolean filters, or expression and partial indexes for search.
- You can evaluate query plans and account for the documented behavior of ranking with filters and partition-local statistics.
Look elsewhere if
- You need one globally comparable BM25 score across partitions, since statistics are local to each partition.
- Your workload depends on Boolean filtering and BM25 ranking being optimized as a single index scan. The README says this combination currently filters, scores matching rows, then sorts.
- Your team cannot take on the operational implications of a PostgreSQL extension that requires shared preloading and index maintenance.
All health signals
| Last commit | 2026-10-16 (7 days ago) |
|---|---|
| Commits, last 90 days | 70 |
| Releases, last 12 months | 21 (latest v1.5.1, 2026-10-02) |
| Contributors | 12 (top contributor: 75% of commits) |
| Issues closed, last 90 days | 23+ (typically closed in 6 days) |
| Pull requests merged, last 90 days | 72 (typically merged in 1 day) |
| Project age | 16 months |
Checked on 2026-10-24 with the GitHub API.
Project history
Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.
Stars
4,065Forks
132Change since Nov 17, 2026: 0 stars·0 forks
Overview
pg_textsearch is a PostgreSQL extension for modern, BM25 relevance-ranked full-text search. It adds a bm25 index access method and a <@> scoring operator, so applications can rank text results directly in PostgreSQL rather than sending search work to a separate service. Block-Max WAND supports fast top-k scans when PostgreSQL chooses an ordered BM25 index scan.
It is aimed at PostgreSQL applications that need configurable relevance ranking alongside familiar database features. The extension supports PostgreSQL text search configurations, Boolean filtering, and several index forms, including expression, partial, and partitioned indexes. It supports PostgreSQL 17 and 18; PostgreSQL 19 is best-effort while in beta.
Key Features
- BM25 ranking with configurable term-frequency saturation (
k1) and length normalization (b). - Block-Max WAND for top-k ranking queries using an ordered BM25 index scan.
- PostgreSQL text search configurations for tokenization and language-specific search.
- Boolean
tsqueryfiltering, including AND, OR, NOT, phrase, prefix, and weight operators. - Expression, partial, and partitioned-table indexes, with explicit query syntax available when index inference is ambiguous.
- Parallel index builds, compressed segments, and configurable inline, background, or manual compaction.
- A shared-memory memtable cache with a durable, WAL-logged on-disk source of truth.
Use Cases
- A PostgreSQL application needs relevance-ranked document search without routing queries to a separate search system.
- A product catalog or content database needs top-k text results with category or other SQL filtering.
- An application searches multilingual content and can maintain separate language-specific indexes and text configurations.
- A team searches text stored in JSONB fields or composed from multiple columns using expression indexes.
What you need
Detected in the repository
- C (main language on GitHub)
- A test suite and automated checks on GitHub Actions
License in plain words
PostgreSQL
Read the LICENSE file before using it in a product.
Getting Started
Build and install from source on Linux or macOS:
git clone https://github.com/timescale/pg_textsearch
cd pg_textsearch
make
make install
Add pg_textsearch to shared_preload_libraries in postgresql.conf, restart PostgreSQL, then run CREATE EXTENSION pg_textsearch; in the target database. See the README for package installation, platform-specific instructions, configuration, and upgrade guidance.
Alternatives
- paradedb: ParadeDB provides PostgreSQL search alongside vector retrieval and analytics, rather than focusing on BM25 ranking with Block-Max WAND.
- flexsearch: FlexSearch is a JavaScript search library for browsers and Node.js, rather than a PostgreSQL extension using database indexes.
| Project | Language | License | Stars | Status |
|---|---|---|---|---|
| pg_textsearch | C | PostgreSQL | 4k | Active |
| paradedb | Rust | AGPL-3.0 | 9.3k | Active |
| flexsearch | JavaScript | Apache-2.0 | 13.8k | Quiet |
Considerations
- The extension supports PostgreSQL 17 and 18. PostgreSQL 19 support is best-effort, and the README notes that CI may fail and prebuilt binaries are not published for it yet.
shared_preload_librariesmust include the extension, and its indexes have operational details around spills, compaction, memory, and standby-safe page reclaim.- BM25 statistics for partitioned tables are local to each partition, so scores may not be comparable across partitions.
- Boolean filtering combined with BM25 ranking is not currently a single optimized index scan. Other conditions on an ordered BM25 scan can also act as post-filters.
- RLS-protected rows affect corpus statistics, which can reveal frequency information about terms even when rows are hidden. The README documents a superuser-only setting to reject certain RLS and BM25 combinations.
- Project activity is strong, with regular commits and releases and prompt issue and pull-request handling, but most contributions come from one contributor. The PostgreSQL license is stated as PostgreSQL in the repository metadata.
Found this useful?
Share it with someone who would like pg_textsearch.