USearch
Constants
VERSION = "0.1.0"
Class methods
exact_search(dataset : Array(Array(Float32)), queries : Array(Array(Float32)), k : Int = 10, metric : MetricKind = :cos, threads : Int = 1) : Array(Array(SearchResult))
Performs exact (brute-force) search across a dataset.
This is useful for:
-
Small datasets where brute force is acceptable
-
Computing ground truth to verify HNSW results
-
Benchmarking approximate vs exact search
-
dataset: Array of vectors to search through -
queries: Array of query vectors -
k: Number of nearest neighbors per query -
metric: Distance metric (default: cosine) -
threads: Number of threads (default: 1)
Returns an array of results per query, where each result is an array of SearchResult.