Skip to content

Commit 535795d

Browse files
committed
[paradedb] Fix hallucinated example
1 parent b255207 commit 535795d

1 file changed

Lines changed: 13 additions & 15 deletions

File tree

paradedb/README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,23 @@ conn = psycopg2.connect(
4040
ParadeDB includes the **pg_search** extension, for both search and
4141
analytics workloads.
4242

43-
Example using pg_search:
43+
Example of BM25 scoring, from the excellent [quickstart guide](https://docs.paradedb.com/documentation/getting-started/quickstart):
44+
4445
```sql
45-
-- Create a table with search index
46-
CREATE TABLE products (
47-
id SERIAL PRIMARY KEY,
48-
name TEXT,
49-
description TEXT
46+
CALL paradedb.create_bm25_test_table(
47+
schema_name => 'public',
48+
table_name => 'mock_items'
5049
);
5150

52-
-- Create a BM25 search index
53-
CALL paradedb.create_bm25(
54-
index_name => 'products_idx',
55-
table_name => 'products',
56-
key_field => 'id',
57-
text_fields => paradedb.field('name') || paradedb.field('description')
58-
);
51+
CREATE INDEX search_idx ON mock_items
52+
USING bm25 (id, description, category, rating, in_stock, created_at, metadata, weight_range)
53+
WITH (key_field='id');
5954

60-
-- Search with BM25 scoring
61-
SELECT * FROM products.search('description:electronics');
55+
SELECT description, pdb.score(id)
56+
FROM mock_items
57+
WHERE description ||| 'running shoes' AND rating > 2
58+
ORDER BY score DESC
59+
LIMIT 5;
6260
```
6361

6462
## Configuration

0 commit comments

Comments
 (0)