Skip to content

Conversation

@jan-kaczorowski
Copy link

No description provided.

Jan Kaczorowski and others added 5 commits July 23, 2025 10:18
This commit adds support for ParadeDB's pg_search PostgreSQL extension,
which provides BM25-based full-text search as an alternative to the
built-in PostgreSQL text search features.

Key changes:
- Add ParadeDB feature class implementing the @@@ operator and paradedb.score()
- Support for various query types: standard, phrase, prefix, and fuzzy search
- Add migration generator for creating pg_search extension and BM25 indexes
- Include comprehensive tests for ParadeDB functionality
- Add documentation with usage examples

Usage:
  PgSearch.multisearch_options = { using: :paradedb }

This provides an alternative search backend using BM25 ranking algorithm
which often provides better relevance scoring than traditional TF-IDF.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This commit extends ParadeDB support to work with pg_search_scope,
enabling BM25 search on individual models.

Key features:
- Auto-creates BM25 indexes on model tables when using ParadeDB
- Supports all ParadeDB query types (standard, phrase, prefix, fuzzy)
- Handles multi-column searches with proper indexing
- Manages long index names (PostgreSQL 63-char limit)
- Includes primary key in index for paradedb.score() function
- Works alongside existing search methods (tsearch, trigram)

Configuration options:
- query_type: Choose between standard, phrase, prefix, or fuzzy search
- auto_create_index: Enable/disable automatic BM25 index creation
- check_extension: Enable/disable extension verification
- index_name: Specify custom index names
- key_field: Override the primary key field for scoring

Example usage:
  pg_search_scope :search_products,
    against: [:name, :description],
    using: {
      paradedb: {
        query_type: :phrase,
        auto_create_index: true
      }
    }

Added comprehensive documentation and test scripts to demonstrate
proper usage and integration patterns.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant