Skip to content

Commit cbce7ee

Browse files
committed
Feat: Implement KD Tree Indexer
1 parent caacef0 commit cbce7ee

File tree

5 files changed

+666
-161
lines changed

5 files changed

+666
-161
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/index/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ version = "0.1.0"
66
edition = "2021"
77

88
[dependencies]
9-
9+
serde = { version = "1.0", features = ["derive"] }
1010
core = { path = "../core" }
1111

crates/index/src/flat.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,7 @@ impl VectorIndex for FlatIndex {
4646
let mut scores = self
4747
.index
4848
.iter()
49-
.map(|point| {
50-
(
51-
point.id,
52-
distance(point.vector.clone(), query_vector.clone(), similarity),
53-
)
54-
})
49+
.map(|point| (point.id, distance(&point.vector, &query_vector, similarity)))
5550
.collect::<Vec<_>>();
5651

5752
// Sorting logic according to type of metric used

0 commit comments

Comments
 (0)