pub struct ScoredDoc {
pub id: String,
pub score: f32,
pub metadata: Value,
}Expand description
A document returned from a vector-store or retriever query, with its relevance score.
score is a cosine similarity in [-1.0, 1.0] where higher is more
similar. Results from this module’s stores are returned in descending
score order (most similar first).
Fields§
§id: StringCaller-supplied identifier of the matched document.
score: f32Cosine similarity to the query vector; higher is more similar.
metadata: ValueArbitrary metadata associated with the document at index time.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ScoredDoc
impl<'de> Deserialize<'de> for ScoredDoc
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for ScoredDoc
Auto Trait Implementations§
impl Freeze for ScoredDoc
impl RefUnwindSafe for ScoredDoc
impl Send for ScoredDoc
impl Sync for ScoredDoc
impl Unpin for ScoredDoc
impl UnsafeUnpin for ScoredDoc
impl UnwindSafe for ScoredDoc
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