We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff9012e commit a7ce7bbCopy full SHA for a7ce7bb
2 files changed
README.md
@@ -308,6 +308,14 @@ Get items within a certain distance
308
Item.select().where(Item.embedding.l2_distance([3, 1, 2]) < 5)
309
```
310
311
+Add an approximate index
312
+
313
+```python
314
+Item.add_index('embedding vector_l2_ops', using='hnsw')
315
+```
316
317
+Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance
318
319
## History
320
321
View the [changelog](https://github.com/pgvector/pgvector-python/blob/master/CHANGELOG.md)
tests/test_peewee.py
@@ -15,6 +15,8 @@ class Item(BaseModel):
15
embedding = VectorField(dimensions=3)
16
17
18
19
20
db.connect()
21
db.execute_sql('CREATE EXTENSION IF NOT EXISTS vector')
22
db.drop_tables([Item])
0 commit comments