pub struct SearchModule { /* private fields */ }Expand description
Search module for semantic code queries.
Implementations§
Source§impl SearchModule
impl SearchModule
Sourcepub fn new(store: Arc<UnifiedGraphStore>) -> Self
pub fn new(store: Arc<UnifiedGraphStore>) -> Self
Create a new SearchModule.
Sourcepub async fn index(&self) -> ForgeResult<()>
pub async fn index(&self) -> ForgeResult<()>
Indexes the codebase for search.
This is a no-op for the current implementation which scans files directly. In a future version with embedding-based search, this would build the index.
Sourcepub async fn pattern_search(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
pub async fn pattern_search(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
Pattern-based search using regex (async).
Scans source files for patterns like “fn \w+(” and returns matching symbols.
Sourcepub async fn pattern(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
pub async fn pattern(&self, pattern: &str) -> ForgeResult<Vec<Symbol>>
Pattern-based search (alias for pattern_search).
Sourcepub async fn semantic_search(&self, query: &str) -> ForgeResult<Vec<Symbol>>
pub async fn semantic_search(&self, query: &str) -> ForgeResult<Vec<Symbol>>
Semantic search using natural language (async).
Note: True semantic search would require embedding generation. This implementation uses keyword matching on symbol names, with substring matching for partial word matches.
Sourcepub async fn semantic(&self, query: &str) -> ForgeResult<Vec<Symbol>>
pub async fn semantic(&self, query: &str) -> ForgeResult<Vec<Symbol>>
Semantic search (alias for semantic_search).
Sourcepub async fn symbol_by_name(&self, name: &str) -> ForgeResult<Option<Symbol>>
pub async fn symbol_by_name(&self, name: &str) -> ForgeResult<Option<Symbol>>
Find a specific symbol by name (async).
Sourcepub async fn symbols_by_kind(
&self,
kind: SymbolKind,
) -> ForgeResult<Vec<Symbol>>
pub async fn symbols_by_kind( &self, kind: SymbolKind, ) -> ForgeResult<Vec<Symbol>>
Find all symbols of a specific kind (async).
Auto Trait Implementations§
impl Freeze for SearchModule
impl RefUnwindSafe for SearchModule
impl Send for SearchModule
impl Sync for SearchModule
impl Unpin for SearchModule
impl UnsafeUnpin for SearchModule
impl UnwindSafe for SearchModule
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> 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