pg-search-bm25

Index BM25 text searches in Postgres with the pg_search extension.

Updated Apr 22, 2026
One-click install
npx skills add https://github.com/Mercurium-Analytics/pg-search-vector --skill pg-search-bm25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pg-search-bm25
Source: https://github.com/Mercurium-Analytics/pg-search-vector/tree/main/skills/pg-search-bm25
Command: npx skills add https://github.com/Mercurium-Analytics/pg-search-vector --skill pg-search-bm25

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL users can achieve Elasticsearch-quality BM25 ranking and advanced text search capabilities by using the pg_search extension, enabling powerful, in-database search without external engines.

Core Features & Use Cases

  • BM25 ranking for multi-field text searches inside Postgres
  • Phrase queries, fuzzy matching, and regex support
  • Customizable tokenization for autocomplete and typo tolerance

Quick Start

Install the pg_search extension, create a BM25 index on your searchable text columns, and query with the @@@ operator to return ranked results.

Frequently Asked Questions about pg-search-bm25

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement BM25 full-text search inside Postgres?

You implement BM25 full-text search in Postgres by installing the pg_search extension, creating a BM25 index on target text columns, and querying using the @@@ operator to return relevance-ranked results.

Can I do fuzzy matching and typo-tolerant autocomplete in PostgreSQL?

Yes, you can achieve fuzzy matching and typo-tolerant autocomplete in PostgreSQL by using the pg_search extension with customizable tokenizers to handle phrase queries and regex patterns inside your database.

How does BM25 search in Postgres compare to using an external search engine?

BM25 search in Postgres provides Elasticsearch-quality text ranking and advanced search capabilities directly inside your database, eliminating the need to synchronize data with an external search engine.

Do I need a specific PostgreSQL version to use the pg_search extension?

Yes, implementing BM25 search with the pg_search extension requires PostgreSQL version 15 or higher to create BM25 indexes and execute multi-field ranked text queries.

How do I retrieve relevance scores for BM25 search results in Postgres?

You retrieve relevance scores for BM25 search results in Postgres by querying your indexed columns with the @@@ operator and returning the paradedb.score function to evaluate document ranking.