pub struct IndexStats {
pub chunks: usize,
pub files: usize,
pub vectors: Option<usize>,
pub by_language: Vec<(Language, usize)>,
pub by_kind: Vec<(ChunkKind, usize)>,
pub embedder: String,
pub store: String,
}Expand description
A breakdown of what an index currently holds.
Fields§
§chunks: usize§files: usize§vectors: Option<usize>Vectors held by the store, when one is open. Should track chunks; a
gap means the store and the chunk metadata have drifted apart. None
after a metadata-only read, where the store was never loaded.
by_language: Vec<(Language, usize)>Chunk counts per language, most frequent first.
by_kind: Vec<(ChunkKind, usize)>Chunk counts per kind, most frequent first.
embedder: StringFingerprint of the embedder that produced the vectors.
store: StringFingerprint of the store holding them, i.e. its distance metric.
Implementations§
Source§impl IndexStats
impl IndexStats
Sourcepub fn open(index_dir: &Path) -> Result<Self, RagError>
pub fn open(index_dir: &Path) -> Result<Self, RagError>
Summarize the index at index_dir from its metadata alone.
Reads the chunk registry and the manifest, and nothing else: no
embedding model is loaded and no vectors are touched, so inspecting an
index costs milliseconds. The trade-off is that vectors stays None,
because only the store knows how many it holds.
Trait Implementations§
Source§impl Clone for IndexStats
impl Clone for IndexStats
Source§fn clone(&self) -> IndexStats
fn clone(&self) -> IndexStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for IndexStats
impl RefUnwindSafe for IndexStats
impl Send for IndexStats
impl Sync for IndexStats
impl Unpin for IndexStats
impl UnsafeUnpin for IndexStats
impl UnwindSafe for IndexStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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