use super::hnsw::HnswVectorHit;
use super::ivf::IvfVectorHit;
use super::turbo_quant::TurboQuantVectorHit;
#[derive(Clone, Debug, PartialEq)]
pub(crate) struct VectorIndexSearchHit {
pub(crate) row: u32,
pub(crate) distance: f64,
}
pub(crate) fn hnsw_hits(hits: Vec<HnswVectorHit>) -> Vec<VectorIndexSearchHit> {
hits.into_iter()
.map(|hit| VectorIndexSearchHit {
row: hit.row,
distance: hit.distance,
})
.collect()
}
pub(crate) fn ivf_hits(hits: Vec<IvfVectorHit>) -> Vec<VectorIndexSearchHit> {
hits.into_iter()
.map(|hit| VectorIndexSearchHit {
row: hit.row,
distance: hit.distance,
})
.collect()
}
pub(crate) fn turbo_quant_hits(hits: Vec<TurboQuantVectorHit>) -> Vec<VectorIndexSearchHit> {
hits.into_iter()
.map(|hit| VectorIndexSearchHit {
row: hit.row,
distance: hit.distance,
})
.collect()
}