@@ -78,24 +78,24 @@ Now you can query for similar items:
7878await vec.search([1.0 , 9.0 ])
7979```
8080
81- [<Record id=UUID('1bd6a985-a837-4742-a007-d8a785e7089f ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>,
82- <Record id=UUID('2e52b4a4-3422-42d7-8e62-fd40731e7ffa ') metadata={'animal': 'fox'} contents='the brown fox' embedding=array([1. , 1.3], dtype=float32) distance=0.14489260377438218>]
81+ [<Record id=UUID('9b567b36-209e-4240-aa93-f8e7e74277cd ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>,
82+ <Record id=UUID('2d49fd73-3db1-4061-81f3-a4ed7529eb61 ') metadata={'animal': 'fox'} contents='the brown fox' embedding=array([1. , 1.3], dtype=float32) distance=0.14489260377438218>]
8383
8484You can specify the number of records to return.
8585
8686``` python
8787await vec.search([1.0 , 9.0 ], limit = 1 )
8888```
8989
90- [<Record id=UUID('1bd6a985-a837-4742-a007-d8a785e7089f ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>]
90+ [<Record id=UUID('9b567b36-209e-4240-aa93-f8e7e74277cd ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>]
9191
9292You can also specify a filter on the metadata as a simple dictionary
9393
9494``` python
9595await vec.search([1.0 , 9.0 ], limit = 1 , filter = {" action" : " jump" })
9696```
9797
98- [<Record id=UUID('1bd6a985-a837-4742-a007-d8a785e7089f ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>]
98+ [<Record id=UUID('9b567b36-209e-4240-aa93-f8e7e74277cd ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>]
9999
100100You can also specify a list of filter dictionaries, where an item is
101101returned if it matches any dict
@@ -104,8 +104,8 @@ returned if it matches any dict
104104await vec.search([1.0 , 9.0 ], limit = 2 , filter = [{" action" : " jump" }, {" animal" : " fox" }])
105105```
106106
107- [<Record id=UUID('1bd6a985-a837-4742-a007-d8a785e7089f ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>,
108- <Record id=UUID('2e52b4a4-3422-42d7-8e62-fd40731e7ffa ') metadata={'animal': 'fox'} contents='the brown fox' embedding=array([1. , 1.3], dtype=float32) distance=0.14489260377438218>]
107+ [<Record id=UUID('9b567b36-209e-4240-aa93-f8e7e74277cd ') metadata={'action': 'jump', 'animal': 'fox'} contents='jumped over the' embedding=array([ 1. , 10.8], dtype=float32) distance=0.00016793422934946456>,
108+ <Record id=UUID('2d49fd73-3db1-4061-81f3-a4ed7529eb61 ') metadata={'animal': 'fox'} contents='the brown fox' embedding=array([1. , 1.3], dtype=float32) distance=0.14489260377438218>]
109109
110110You can access the fields as follows
111111
@@ -114,7 +114,7 @@ records = await vec.search([1.0, 9.0], limit=1, filter={"action": "jump"})
114114records[0 ][client.SEARCH_RESULT_ID_IDX ]
115115```
116116
117- UUID('1bd6a985-a837-4742-a007-d8a785e7089f ')
117+ UUID('9b567b36-209e-4240-aa93-f8e7e74277cd ')
118118
119119``` python
120120records[0 ][client.SEARCH_RESULT_METADATA_IDX ]
@@ -176,7 +176,7 @@ You can create an ivfflat index with the following command after the
176176table has been populated.
177177
178178``` python
179- await vec.create_ivfflat_index( )
179+ await vec.create_embedding_index(client.IvfflatIndex() )
180180```
181181
182182Please note it is very important to do this only after you have data in
0 commit comments