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_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
Auto Trait Implementations§
impl Freeze for Indexer
impl RefUnwindSafe for Indexer
impl Send for Indexer
impl Sync for Indexer
impl Unpin 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