You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,48 @@ The official [SQLAlchemy](https://www.sqlalchemy.org/) integration for [ParadeDB
47
47
| ParadeDB | 0.22.0+ |
48
48
| PostgreSQL | 15+ (with ParadeDB extension) |
49
49
50
+
## Vector Search
51
+
52
+
ParadeDB indexes pgvector `vector` columns directly inside BM25 indexes, so no pgvector ORM library is needed. Declare a `vector(n)` column with the built-in `Vector` type, add it to the BM25 index with `VectorField` and a distance metric, and order by the matching distance function:
53
+
54
+
```python
55
+
from sqlalchemy import Index, select
56
+
from paradedb.sqlalchemy import search, vector
57
+
from paradedb.sqlalchemy.indexing import BM25Field, VectorField
The ORDER BY distance function must match the index metric: `vector.l2_distance` (`<->`) with `metric="l2"`, `vector.cosine_distance` (`<=>`) with `metric="cosine"`, and `vector.inner_product` (`<#>`) with `metric="ip"`. A mismatched pair still returns correct results but silently loses Top-K index pushdown.
89
+
90
+
Vector search requires a ParadeDB build with vector-in-bm25 support and the `vector` (pgvector) extension installed.
91
+
50
92
## Examples
51
93
52
94
-[Quick Start](examples/quickstart/quickstart.py)
@@ -55,6 +97,7 @@ The official [SQLAlchemy](https://www.sqlalchemy.org/) integration for [ParadeDB
55
97
-[More Like This](examples/more_like_this/more_like_this.py)
0 commit comments