pub struct HashSearchIterator { /* private fields */ }Expand description
Iterator for RediSearch FT.SEARCH results.
Unlike HashBatchIterator which uses SCAN, this iterator uses RediSearch’s
FT.SEARCH with LIMIT for pagination, enabling server-side filtering.
Implementations§
Source§impl HashSearchIterator
impl HashSearchIterator
Sourcepub fn new(
url: &str,
schema: HashSchema,
config: SearchBatchConfig,
projection: Option<Vec<String>>,
) -> Result<Self>
pub fn new( url: &str, schema: HashSchema, config: SearchBatchConfig, projection: Option<Vec<String>>, ) -> Result<Self>
Create a new HashSearchIterator.
§Arguments
url- Redis connection URLschema- Schema defining the expected fields and typesconfig- Search configuration (index, query, etc.)projection- Optional list of fields to return
Sourcepub fn next_batch(&mut self) -> Result<Option<RecordBatch>>
pub fn next_batch(&mut self) -> Result<Option<RecordBatch>>
Get the next batch of search results as a RecordBatch.
Returns None when iteration is complete.
Sourcepub fn rows_yielded(&self) -> usize
pub fn rows_yielded(&self) -> usize
Get the number of rows yielded so far.
Sourcepub fn total_results(&self) -> Option<usize>
pub fn total_results(&self) -> Option<usize>
Get the total number of matching documents (available after first batch).
Auto Trait Implementations§
impl !Freeze for HashSearchIterator
impl !RefUnwindSafe for HashSearchIterator
impl Send for HashSearchIterator
impl Sync for HashSearchIterator
impl Unpin for HashSearchIterator
impl !UnwindSafe for HashSearchIterator
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> 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