Skip to content

Commit 0b2cec7

Browse files
committed
feat!: rename bm25 APIs to paradedb and always use the paradedb access method (paradedb/paradedb#5706)
1 parent 02f6f91 commit 0b2cec7

25 files changed

Lines changed: 256 additions & 141 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format
44

55
## [Unreleased]
66

7+
### Changed
8+
9+
- **BREAKING**: Renamed the `bm25`-named migration helpers to `paradedb`: `add_bm25_index` is now `add_paradedb_index`, `remove_bm25_index` is now `remove_paradedb_index`, and `reindex_bm25` is now `reindex_paradedb_index`. The old names were removed; update migrations and `schema.rb` files to the new names.
10+
- **BREAKING**: Index creation always emits `USING paradedb`, which requires pg_search 0.25.0+. There is no option to select the legacy `bm25` access method.
11+
712
[0.9.0] - 2026-07-14
813

914
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
## ParadeDB for Rails
3838

39-
The official ActiveRecord integration for [ParadeDB](https://paradedb.com) (powered by the [`pg_search`](https://github.com/paradedb/paradedb) Postgres extension), including first-class support for managing BM25 indexes and running queries using the full ParadeDB API. Follow the [getting started guide](https://docs.paradedb.com/documentation/getting-started/environment#rails) to begin.
39+
The official ActiveRecord integration for [ParadeDB](https://paradedb.com) (powered by the [`pg_search`](https://github.com/paradedb/paradedb) Postgres extension), including first-class support for managing ParadeDB indexes and running queries using the full ParadeDB API. Follow the [getting started guide](https://docs.paradedb.com/documentation/getting-started/environment#rails) to begin.
4040

4141
## Requirements & Compatibility
4242

examples/autocomplete/setup.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class AutocompleteExampleApp < Rails::Application
2020
module AutocompleteSetup
2121
module_function
2222

23-
def drop_bm25_indexes!(conn, table_name)
23+
def drop_paradedb_indexes!(conn, table_name)
2424
indexes = conn.select_values(<<~SQL)
2525
SELECT indexname
2626
FROM pg_indexes
2727
WHERE schemaname = 'public'
2828
AND tablename = #{conn.quote(table_name.to_s)}
29-
AND indexdef LIKE '%USING bm25%'
29+
AND (indexdef LIKE '%USING bm25%' OR indexdef LIKE '%USING paradedb%')
3030
SQL
3131

3232
indexes.each do |index_name|
@@ -61,7 +61,7 @@ def setup_mock_items!
6161
conn.execute(
6262
"CALL paradedb.create_bm25_test_table(schema_name => 'public', table_name => 'mock_items');"
6363
)
64-
drop_bm25_indexes!(conn, :mock_items)
64+
drop_paradedb_indexes!(conn, :mock_items)
6565
conn.create_paradedb_index(MockItemIndex, if_not_exists: true)
6666

6767
MockItem.reset_column_information
@@ -97,7 +97,7 @@ def setup_autocomplete_table!
9797
puts " + Copied #{count} products from #{MockItem.table_name}"
9898

9999
puts "\nCreating autocomplete-optimized BM25 index..."
100-
conn.remove_bm25_index(:autocomplete_items, name: :autocomplete_items_idx, if_exists: true)
100+
conn.remove_paradedb_index(:autocomplete_items, name: :autocomplete_items_idx, if_exists: true)
101101
conn.create_paradedb_index(AutocompleteItemIndex, if_not_exists: true)
102102

103103
puts " + Created BM25 index with:"

examples/faceted_search/setup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def setup_mock_items!
4848
)
4949
conn.execute("DROP TABLE IF EXISTS mock_items_faceted_search CASCADE;")
5050
conn.execute("CREATE TABLE mock_items_faceted_search AS TABLE mock_items;")
51-
conn.remove_bm25_index(:mock_items_faceted_search, name: :mock_items_faceted_search_bm25_idx, if_exists: true)
51+
conn.remove_paradedb_index(:mock_items_faceted_search, name: :mock_items_faceted_search_bm25_idx, if_exists: true)
5252
conn.create_paradedb_index(MockItemIndex, if_not_exists: true)
5353

5454
MockItem.reset_column_information

examples/hybrid_rrf/setup.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def setup_mock_items!
5656
)
5757
conn.execute("DROP TABLE IF EXISTS mock_items_hybrid_rrf CASCADE;")
5858
conn.execute("CREATE TABLE mock_items_hybrid_rrf AS TABLE mock_items;")
59-
conn.remove_bm25_index(:mock_items_hybrid_rrf, name: :mock_items_hybrid_rrf_bm25_idx, if_exists: true)
59+
conn.remove_paradedb_index(:mock_items_hybrid_rrf, name: :mock_items_hybrid_rrf_bm25_idx, if_exists: true)
6060
conn.create_paradedb_index(MockItemIndex, if_not_exists: true)
6161

6262
MockItem.reset_column_information

examples/more_like_this/setup.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ class MoreLikeThisExampleApp < Rails::Application
1919
module MoreLikeThisSetup
2020
module_function
2121

22-
def drop_bm25_indexes!(conn, table_name)
22+
def drop_paradedb_indexes!(conn, table_name)
2323
indexes = conn.select_values(<<~SQL)
2424
SELECT indexname
2525
FROM pg_indexes
2626
WHERE schemaname = 'public'
2727
AND tablename = #{conn.quote(table_name.to_s)}
28-
AND indexdef LIKE '%USING bm25%'
28+
AND (indexdef LIKE '%USING bm25%' OR indexdef LIKE '%USING paradedb%')
2929
SQL
3030

3131
indexes.each do |index_name|
@@ -60,7 +60,7 @@ def setup_mock_items!
6060
conn.execute(
6161
"CALL paradedb.create_bm25_test_table(schema_name => 'public', table_name => 'mock_items');"
6262
)
63-
drop_bm25_indexes!(conn, :mock_items)
63+
drop_paradedb_indexes!(conn, :mock_items)
6464
conn.create_paradedb_index(MockItemIndex, if_not_exists: true)
6565

6666
MockItem.reset_column_information

examples/quickstart/setup.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ class QuickstartExampleApp < Rails::Application
1919
module QuickstartSetup
2020
module_function
2121

22-
def drop_bm25_indexes!(conn, table_name)
22+
def drop_paradedb_indexes!(conn, table_name)
2323
indexes = conn.select_values(<<~SQL)
2424
SELECT indexname
2525
FROM pg_indexes
2626
WHERE schemaname = 'public'
2727
AND tablename = #{conn.quote(table_name.to_s)}
28-
AND indexdef LIKE '%USING bm25%'
28+
AND (indexdef LIKE '%USING bm25%' OR indexdef LIKE '%USING paradedb%')
2929
SQL
3030

3131
indexes.each do |index_name|
@@ -60,7 +60,7 @@ def setup_mock_items!
6060
conn.execute(
6161
"CALL paradedb.create_bm25_test_table(schema_name => 'public', table_name => 'mock_items');"
6262
)
63-
drop_bm25_indexes!(conn, :mock_items)
63+
drop_paradedb_indexes!(conn, :mock_items)
6464
conn.create_paradedb_index(MockItemIndex, if_not_exists: true)
6565

6666
MockItem.reset_column_information

examples/rag/setup.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ class RagExampleApp < Rails::Application
1919
module RagSetup
2020
module_function
2121

22-
def drop_bm25_indexes!(conn, table_name)
22+
def drop_paradedb_indexes!(conn, table_name)
2323
indexes = conn.select_values(<<~SQL)
2424
SELECT indexname
2525
FROM pg_indexes
2626
WHERE schemaname = 'public'
2727
AND tablename = #{conn.quote(table_name.to_s)}
28-
AND indexdef LIKE '%USING bm25%'
28+
AND (indexdef LIKE '%USING bm25%' OR indexdef LIKE '%USING paradedb%')
2929
SQL
3030

3131
indexes.each do |index_name|
@@ -60,7 +60,7 @@ def setup_mock_items!
6060
conn.execute(
6161
"CALL paradedb.create_bm25_test_table(schema_name => 'public', table_name => 'mock_items');"
6262
)
63-
drop_bm25_indexes!(conn, :mock_items)
63+
drop_paradedb_indexes!(conn, :mock_items)
6464
conn.create_paradedb_index(MockItemIndex, if_not_exists: true)
6565

6666
MockItem.reset_column_information

lib/generators/parade_db/index/index_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class IndexGenerator < Rails::Generators::NamedBase
1515
class_option :concurrent, type: :boolean, default: false,
1616
desc: "Add disable_ddl_transaction! to the migration (required for concurrent index creation)"
1717

18-
desc "Creates a ParadeDB::Index class and a BM25 index migration for MODEL."
18+
desc "Creates a ParadeDB::Index class and a ParadeDB index migration for MODEL."
1919

2020
def self.next_migration_number(dirname)
2121
ActiveRecord::Generators::Base.next_migration_number(dirname)

lib/generators/parade_db/index/templates/migration.rb.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Mi
1010
end
1111

1212
def down
13-
remove_bm25_index :<%= table_name %>, name: :<%= index_name %>, if_exists: true
13+
remove_paradedb_index :<%= table_name %>, name: :<%= index_name %>, if_exists: true
1414
end
1515
end

0 commit comments

Comments
 (0)