diff --git a/Searching-with-HSNW-index.md b/Searching-with-HSNW-index.md index 5471386..da1fd08 100644 --- a/Searching-with-HSNW-index.md +++ b/Searching-with-HSNW-index.md @@ -41,7 +41,12 @@ print(f"\nCreate collection...") collection = Collection(name= collection_name, schema=default_schema) # insert data -mr = collection.insert([xb])print(collection.num_entities) +import random +vectors = [[random.random() for _ in range(8)] for _ in range(10)] +entities = [vectors] +mr = collection.insert(entities) +print(collection.num_entities) + # create index collection.create_index(field_name=field_name, @@ -55,7 +60,7 @@ collection.load() # search top_k = 10 -results = collection.search(data=xq, anns_field="vector", param={ +results = collection.search(vectors[:5], anns_field="vector", param={ "ef": 64 }, limit=top_k)# show results