pub struct MultiScaleIndex {
pub micro_chunk_count: usize,
pub meso_files: HashMap<String, ScaleEntry>,
pub macro_dirs: HashMap<String, ScaleEntry>,
}Expand description
Multi-scale index holding representations at three granularities.
Fields§
§micro_chunk_count: usizeMikro: individual chunks (delegated to BM25Index)
meso_files: HashMap<String, ScaleEntry>Meso: per-file aggregated keywords and statistics
macro_dirs: HashMap<String, ScaleEntry>Makro: per-directory aggregated keywords
Implementations§
Source§impl MultiScaleIndex
impl MultiScaleIndex
pub fn new() -> Self
Sourcepub fn build_from_chunks(chunks: &[CodeChunk]) -> Self
pub fn build_from_chunks(chunks: &[CodeChunk]) -> Self
Build meso and macro scales from chunk-level data.
Sourcepub fn search_meso(
&self,
query_tokens: &[String],
top_k: usize,
) -> Vec<(String, f64)>
pub fn search_meso( &self, query_tokens: &[String], top_k: usize, ) -> Vec<(String, f64)>
Search at the meso (file) scale. Returns file paths with relevance scores.
Sourcepub fn search_macro(
&self,
query_tokens: &[String],
top_k: usize,
) -> Vec<(String, f64)>
pub fn search_macro( &self, query_tokens: &[String], top_k: usize, ) -> Vec<(String, f64)>
Search at the macro (directory) scale. Returns directory paths with relevance.
Sourcepub fn entry_scale(query_type: &QueryType) -> Scale
pub fn entry_scale(query_type: &QueryType) -> Scale
Determine which scale to start search from based on query type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiScaleIndex
impl RefUnwindSafe for MultiScaleIndex
impl Send for MultiScaleIndex
impl Sync for MultiScaleIndex
impl Unpin for MultiScaleIndex
impl UnsafeUnpin for MultiScaleIndex
impl UnwindSafe for MultiScaleIndex
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> 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>
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