pub struct DistributedIndex { /* private fields */ }Expand description
Heterogeneous local/remote shard coordinator.
Implementations§
Source§impl DistributedIndex
impl DistributedIndex
Sourcepub fn new(
dimensions: usize,
config: DistributedConfig,
) -> Result<Self, SearchError>
pub fn new( dimensions: usize, config: DistributedConfig, ) -> Result<Self, SearchError>
Sourcepub fn push(&mut self, shard: Arc<dyn SearchShard>) -> Result<(), SearchError>
pub fn push(&mut self, shard: Arc<dyn SearchShard>) -> Result<(), SearchError>
Adds one local or remote shard.
§Errors
Returns a dimension mismatch when shard and coordinator differ.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn search(
&self,
query: &[f32],
count: usize,
) -> Result<Vec<SearchHit>, SearchError>
pub fn search( &self, query: &[f32], count: usize, ) -> Result<Vec<SearchHit>, SearchError>
Fans one query out with bounded workers and keeps the best occurrence of duplicate keys.
§Errors
Returns a query, worker, allocation, or shard error.
Sourcepub fn search_batch(
&self,
queries: &[&[f32]],
count: usize,
) -> Result<Vec<Vec<SearchHit>>, SearchError>
pub fn search_batch( &self, queries: &[&[f32]], count: usize, ) -> Result<Vec<Vec<SearchHit>>, SearchError>
Searches independent queries while keeping total local threads within
worker_budget.
§Errors
Returns the first query or shard error in input order.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DistributedIndex
impl !UnwindSafe for DistributedIndex
impl Freeze for DistributedIndex
impl Send for DistributedIndex
impl Sync for DistributedIndex
impl Unpin for DistributedIndex
impl UnsafeUnpin for DistributedIndex
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