pub struct Indexer { /* private fields */ }Expand description
Document indexer for the RAG system
Implementations§
Source§impl Indexer
impl Indexer
Sourcepub fn get_index_path(&self) -> &PathBuf
pub fn get_index_path(&self) -> &PathBuf
Get the index directory path
Sourcepub fn index_document(&self, path: PathBuf) -> Result<Vec<DocumentChunk>>
pub fn index_document(&self, path: PathBuf) -> Result<Vec<DocumentChunk>>
Index a single document
Sourcepub fn index_directory(&self, dir_path: PathBuf) -> Result<Vec<DocumentChunk>>
pub fn index_directory(&self, dir_path: PathBuf) -> Result<Vec<DocumentChunk>>
Index all documents in a directory
Sourcepub async fn index_single_url_no_crawl(
&self,
url: &str,
) -> Result<Vec<DocumentChunk>>
pub async fn index_single_url_no_crawl( &self, url: &str, ) -> Result<Vec<DocumentChunk>>
Index a single URL without invoking the crawler (depth 0 semantics)
Sourcepub async fn index_url(&self, url: String) -> Result<Vec<DocumentChunk>>
pub async fn index_url(&self, url: String) -> Result<Vec<DocumentChunk>>
Index content from a URL
Sourcepub async fn index_url_deep(
&self,
url: String,
crawl_depth: Option<u32>,
crawl_all: bool,
) -> Result<Vec<DocumentChunk>>
pub async fn index_url_deep( &self, url: String, crawl_depth: Option<u32>, crawl_all: bool, ) -> Result<Vec<DocumentChunk>>
Index content from a URL with documentation-optimized crawling
Sourcepub async fn index_shallow_url(
&self,
url: &str,
max_pages: Option<usize>,
) -> Result<Vec<DocumentChunk>>
pub async fn index_shallow_url( &self, url: &str, max_pages: Option<usize>, ) -> Result<Vec<DocumentChunk>>
Shallow crawl: fetch base page and first-level same-host links (depth 1)
Auto Trait Implementations§
impl Freeze for Indexer
impl RefUnwindSafe for Indexer
impl Send for Indexer
impl Sync for Indexer
impl Unpin for Indexer
impl UnsafeUnpin for Indexer
impl UnwindSafe for Indexer
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