pub struct SearchSession { /* private fields */ }Expand description
Pre-loaded search session: all HNSW indexes loaded into memory once.
Useful for benchmarks and servers that issue many queries against the same snapshot. Avoids re-loading and re-deserializing indexes on every call.
Deleted rows are NOT filtered here: unlike search/search_text,
this session does not load deletion vectors or equality delete files —
rows removed via delete_rows/delete_where still appear in results.
Use search when delete visibility matters; this type trades that for
raw throughput on static snapshots (its benchmark use case).
Implementations§
Source§impl SearchSession
impl SearchSession
Sourcepub async fn load(
table: &TableIdent,
vector_column: &str,
dim: u32,
catalog: Arc<dyn CatalogProvider>,
store: Arc<dyn Store>,
load_raw: bool,
) -> AilakeResult<Self>
pub async fn load( table: &TableIdent, vector_column: &str, dim: u32, catalog: Arc<dyn CatalogProvider>, store: Arc<dyn Store>, load_raw: bool, ) -> AilakeResult<Self>
Load all indexes for the latest snapshot into memory.
Pass load_raw = true when reranking will be used (rerank_factor is
Some); it reads the full parquet columns so exact distances are
available without extra I/O during search_query.
Sourcepub fn shard_count(&self) -> usize
pub fn shard_count(&self) -> usize
Number of loaded shards.
Sourcepub fn search_batch(
&self,
queries: &[Vec<f32>],
config: &SearchConfig,
) -> Vec<Vec<SearchResult>>
pub fn search_batch( &self, queries: &[Vec<f32>], config: &SearchConfig, ) -> Vec<Vec<SearchResult>>
Search multiple queries in one call.
For shards with raw vectors (Indexing or reranking): dispatches to GPU batch matmul when a CUDA device is available, falling back to CPU flat scan. For indexed shards (HNSW / IVF-PQ): rayon parallel-map over queries — graph traversal is inherently sequential and has no GPU batch path.
Returns one Vec<SearchResult> per input query, in the same order.
Sourcepub fn search_query(
&self,
query: &[f32],
config: &SearchConfig,
) -> Vec<SearchResult>
pub fn search_query( &self, query: &[f32], config: &SearchConfig, ) -> Vec<SearchResult>
Search using pre-loaded indexes. No I/O — pure in-memory search.
Auto Trait Implementations§
impl Freeze for SearchSession
impl RefUnwindSafe for SearchSession
impl Send for SearchSession
impl Sync for SearchSession
impl Unpin for SearchSession
impl UnsafeUnpin for SearchSession
impl UnwindSafe for SearchSession
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
&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)
&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> 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> ⓘ
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