pub struct SearchHit {
pub key: RecordKey,
pub score: f64,
pub text_score: Option<f64>,
pub vector_scores: BTreeMap<String, f64>,
pub rerank_score: Option<f64>,
pub note_chunks: Option<usize>,
pub top_chunks: Vec<ChunkRef>,
pub record: Value,
}Fields§
§key: RecordKey§score: f64Reciprocal rank fusion score, k=60. This is not a probability.
text_score: Option<f64>§vector_scores: BTreeMap<String, f64>§rerank_score: Option<f64>本条目在重排回调那里的分数;未重排时为 None。
note_chunks: Option<usize>本条目是切片时:其所属笔记里命中本次查询的切片总数(按请求的匹配列计,含本条)。
非切片命中、或请求只看名字/目录列时为 None。
它只描述「这篇文档有多少相关片段」,与结果窗口、翻页无关。
top_chunks: Vec<ChunkRef>本条代表的那一篇里,命中本次查询、排名最高的若干片段(第 0 条就是本条自身),
按名次排列、至多 top_chunks_per_note 条。同一篇内的次序取索引里的相关度
(严格词元命中排在宽松命中之前),与命中本身的 score 不同源。
被折叠掉的片段在这里找回来,调用方不必为「同一篇还有别的相关片段」再搜一次。
非切片命中、或请求只看名字/目录列时为空。
record: ValueTrait Implementations§
Source§impl<'de> Deserialize<'de> for SearchHit
impl<'de> Deserialize<'de> for SearchHit
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
Auto Trait Implementations§
impl Freeze for SearchHit
impl RefUnwindSafe for SearchHit
impl Send for SearchHit
impl Sync for SearchHit
impl Unpin for SearchHit
impl UnsafeUnpin for SearchHit
impl UnwindSafe for SearchHit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more