3. Performing Your First Search¶
Estimated time: 7 minutes
Learn how to search for nearest neighbors in your index.
Steps¶
- Create a query vector:
query = np.random.rand(128).astype(np.float32)
- Search the index:
neighbor_ids, distances = index.search(query, k=5) print("Neighbors:", neighbor_ids)