pub struct SearchEngine { /* private fields */ }Expand description
Production-ready search engine with LSP integration
Implementations§
Source§impl SearchEngine
impl SearchEngine
Sourcepub async fn new<P: AsRef<Path>>(index_path: P) -> Result<Self>
pub async fn new<P: AsRef<Path>>(index_path: P) -> Result<Self>
Create new search engine with LSP integration
Sourcepub async fn with_config<P: AsRef<Path>>(
index_path: P,
config: SearchConfig,
) -> Result<Self>
pub async fn with_config<P: AsRef<Path>>( index_path: P, config: SearchConfig, ) -> Result<Self>
Create search engine with custom configuration
Sourcepub fn sanitize_query(&self, query: &str) -> String
pub fn sanitize_query(&self, query: &str) -> String
Sanitize query to prevent Tantivy parsing errors
Sourcepub async fn search(
&self,
query: &str,
limit: usize,
) -> Result<(Vec<SearchResult>, SearchMetrics)>
pub async fn search( &self, query: &str, limit: usize, ) -> Result<(Vec<SearchResult>, SearchMetrics)>
Execute enhanced search with LSP integration
Sourcepub async fn search_comprehensive(
&self,
request: SearchRequest,
) -> Result<SearchResponse>
pub async fn search_comprehensive( &self, request: SearchRequest, ) -> Result<SearchResponse>
Comprehensive search with full feature set
Sourcepub async fn get_metrics(&self) -> EngineMetrics
pub async fn get_metrics(&self) -> EngineMetrics
Get comprehensive engine metrics
Sourcepub async fn index_document(&self, doc: &SearchDocument) -> Result<()>
pub async fn index_document(&self, doc: &SearchDocument) -> Result<()>
Index a document for search
Sourcepub async fn get_current_dataset(&self) -> Option<Arc<PinnedDataset>>
pub async fn get_current_dataset(&self) -> Option<Arc<PinnedDataset>>
Get the current pinned dataset if available
Sourcepub async fn load_dataset_version(&self, version: &str) -> Result<()>
pub async fn load_dataset_version(&self, version: &str) -> Result<()>
Load a specific pinned dataset version
Sourcepub async fn reload_current_dataset(&self) -> Result<()>
pub async fn reload_current_dataset(&self) -> Result<()>
Reload the current pinned dataset
Sourcepub async fn get_dataset_info(&self) -> Option<DatasetInfo>
pub async fn get_dataset_info(&self) -> Option<DatasetInfo>
Get dataset information for the currently loaded dataset
Sourcepub async fn list_dataset_versions(&self) -> Result<Vec<DatasetVersion>>
pub async fn list_dataset_versions(&self) -> Result<Vec<DatasetVersion>>
Get available dataset versions
Sourcepub async fn get_smoke_dataset(&self) -> Option<Vec<GoldenQuery>>
pub async fn get_smoke_dataset(&self) -> Option<Vec<GoldenQuery>>
Get SMOKE test dataset slice from current dataset
Sourcepub async fn get_dataset_slice(
&self,
slice_name: &str,
) -> Option<Vec<GoldenQuery>>
pub async fn get_dataset_slice( &self, slice_name: &str, ) -> Option<Vec<GoldenQuery>>
Get specific dataset slice by name
Sourcepub fn has_dataset_support(&self) -> bool
pub fn has_dataset_support(&self) -> bool
Check if pinned dataset support is enabled and available
Sourcepub async fn validate_current_dataset(&self) -> Result<ValidationResult>
pub async fn validate_current_dataset(&self) -> Result<ValidationResult>
Validate current dataset against corpus
Trait Implementations§
Source§impl SearchEngineSemanticExt for SearchEngine
impl SearchEngineSemanticExt for SearchEngine
Source§async fn search_semantic(
&self,
request: SemanticSearchRequest,
integration: &SemanticSearchIntegration,
) -> Result<SemanticSearchResponse>
async fn search_semantic( &self, request: SemanticSearchRequest, integration: &SemanticSearchIntegration, ) -> Result<SemanticSearchResponse>
Search with semantic enhancement
Source§async fn search_auto_semantic(
&self,
query: &str,
integration: &SemanticSearchIntegration,
) -> Result<SemanticSearchResponse>
async fn search_auto_semantic( &self, query: &str, integration: &SemanticSearchIntegration, ) -> Result<SemanticSearchResponse>
Search with automatic semantic enhancement for natural language queries
Auto Trait Implementations§
impl !RefUnwindSafe for SearchEngine
impl !UnwindSafe for SearchEngine
impl Freeze for SearchEngine
impl Send for SearchEngine
impl Sync for SearchEngine
impl Unpin for SearchEngine
impl UnsafeUnpin for SearchEngine
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> 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>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
Convert
&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)
Convert
&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> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for 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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request