Skip to content

Commit 2cd5506

Browse files
committed
Improved example
1 parent 782b763 commit 2cd5506

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Add an approximate index
4545
```lisp
4646
(query (:create-index 'my-index :on 'items :using hnsw :fields "embedding vector_l2_ops"))
4747
;; or
48-
(query "CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)")
48+
(query (:create-index 'my-index :on 'items :using ivfflat :fields "embedding vector_l2_ops" :with (:= 'lists 100)))
4949
```
5050

5151
Use `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance

postmodern.lisp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
(doquery (:limit (:order-by (:select 'id 'embedding :from 'items) (:<-> 'embedding "[1,1,1]")) 5) (id embedding)
1616
(format t "~A: ~A~%" id embedding))
1717

18-
(query (:create-index 'my-index :on 'items :using hnsw :fields "embedding vector_l2_ops"))
18+
(query (:create-index 'my-hnsw-index :on 'items :using hnsw :fields "embedding vector_l2_ops"))
19+
;; or
20+
(query (:create-index 'my-ivfflat-index :on 'items :using ivfflat :fields "embedding vector_l2_ops" :with (:= 'lists 1)))

0 commit comments

Comments
 (0)