pub struct InvertedIndexMeta {
pub doc_count: u64,
pub total_tokens: u64,
pub avg_doc_length: f32,
}Expand description
Inverted index metadata for a vector.
Fields§
§doc_count: u64Number of documents indexed.
total_tokens: u64Total number of tokens across all documents.
avg_doc_length: f32Average document length (number of non-zero tokens).
Implementations§
Source§impl InvertedIndexMeta
impl InvertedIndexMeta
Sourcepub fn add_document(&mut self, token_count: usize)
pub fn add_document(&mut self, token_count: usize)
Update statistics after adding a document.
Sourcepub fn remove_document(&mut self, token_count: usize)
pub fn remove_document(&mut self, token_count: usize)
Update statistics after removing a document.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, VectorError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, VectorError>
Deserialize from bytes.
Trait Implementations§
Source§impl Clone for InvertedIndexMeta
impl Clone for InvertedIndexMeta
Source§fn clone(&self) -> InvertedIndexMeta
fn clone(&self) -> InvertedIndexMeta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvertedIndexMeta
impl Debug for InvertedIndexMeta
Source§impl Default for InvertedIndexMeta
impl Default for InvertedIndexMeta
Source§impl<'de> Deserialize<'de> for InvertedIndexMeta
impl<'de> Deserialize<'de> for InvertedIndexMeta
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 InvertedIndexMeta
impl RefUnwindSafe for InvertedIndexMeta
impl Send for InvertedIndexMeta
impl Sync for InvertedIndexMeta
impl Unpin for InvertedIndexMeta
impl UnwindSafe for InvertedIndexMeta
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