pub enum Metric {
Cosine,
Dot,
Euclidean,
}Expand description
How similarity is measured. search always returns the highest-scoring
entries, so every metric is oriented “higher = more similar”.
Variants§
Cosine
Cosine similarity in [-1, 1] (1 = identical direction). Magnitude-invariant.
Dot
Raw dot product (higher = more aligned and larger).
Euclidean
Negative Euclidean distance (0 = identical, more negative = farther).
Trait Implementations§
impl Copy for Metric
impl Eq for Metric
impl StructuralPartialEq for Metric
Auto Trait Implementations§
impl Forget for Metric
impl Freeze for Metric
impl RefUnwindSafe for Metric
impl Send for Metric
impl Sync for Metric
impl Unpin for Metric
impl UnsafeUnpin for Metric
impl UnwindSafe for Metric
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more