pg-textsearch

Enable BM25 full-text search in PostgreSQL with hybrid vector search via RRF.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/aydadevelop/turborepo-starter --skill pg-textsearch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pg-textsearch
Source: https://github.com/aydadevelop/turborepo-starter/tree/main/.agents/skills/pg-textsearch
Command: npx skills add https://github.com/aydadevelop/turborepo-starter --skill pg-textsearch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) components.

What problem does it solve?

This Skill provides advanced, corpus-aware full-text search capabilities for PostgreSQL databases, offering superior ranking and performance compared to native solutions.

Core Features & Use Cases

  • BM25 Ranking: Implements BM25 scoring for more relevant search results.
  • Hybrid Search: Enables combining BM25 keyword search with vector-based semantic search using Reciprocal Rank Fusion (RRF).
  • Performance Tuning: Offers detailed configuration and monitoring for optimizing text search performance.
  • Use Case: Integrate powerful keyword search into an e-commerce product catalog or a knowledge base, ensuring users find relevant information quickly.

Quick Start

Create a BM25 index on the 'description' column of the 'listing' table using the 'russian' text configuration.

Frequently Asked Questions about pg-textsearch

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

FAQPage Schema
How do I implement BM25 full-text search in PostgreSQL?

Hybrid search combines BM25 keyword search with vector-based semantic search using Reciprocal Rank Fusion (RRF). This approach merges exact keyword matching with contextual vector embeddings to improve search relevance across large text corpora.

Can I use Drizzle ORM to manage PostgreSQL full-text search indexes?

Yes, pg_textsearch integrates with Drizzle ORM for querying and index management. You can create BM25 indexes and execute advanced text search queries directly through Drizzle ORM within your application layer.

What is the best way to tune PostgreSQL full-text search performance for large corpora?

Tuning PostgreSQL full-text search performance involves configuring custom text configurations and monitoring query execution. The pg_textsearch extension provides detailed configuration options for optimizing search performance on large text corpora.

Does PostgreSQL full-text search support custom text configurations for different languages?

Yes, PostgreSQL full-text search supports custom text configurations for different languages. The pg_textsearch extension allows specifying configurations like 'russian' when creating BM25 indexes to ensure proper linguistic processing.

Why use BM25 ranking instead of native PostgreSQL full-text search ranking?

BM25 ranking provides superior relevance for document retrieval compared to native PostgreSQL full-text search ranking. It calculates term frequency and inverse document frequency to deliver corpus-aware scoring for more accurate search results.