pub struct PartitionedStore { /* private fields */ }Expand description
Partitioned vector store
Implementations§
Source§impl PartitionedStore
impl PartitionedStore
Sourcepub fn new<P: AsRef<Path>>(
base_path: P,
config: PartitionConfig,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( base_path: P, config: PartitionConfig, ) -> Result<Self>
Create new partitioned store
Sourcepub fn insert(
&mut self,
partition_id: &str,
id: String,
vector: Vec<f32>,
metadata: Metadata,
) -> Result<()>
pub fn insert( &mut self, partition_id: &str, id: String, vector: Vec<f32>, metadata: Metadata, ) -> Result<()>
Insert vector into specific partition
Sourcepub fn query_partition(
&self,
partition_id: &str,
query: Query,
) -> Result<Vec<Neighbor>>
pub fn query_partition( &self, partition_id: &str, query: Query, ) -> Result<Vec<Neighbor>>
Query within a specific partition
Sourcepub fn query_all(&self, query: Query, limit: usize) -> Result<Vec<Neighbor>>
pub fn query_all(&self, query: Query, limit: usize) -> Result<Vec<Neighbor>>
Query across all partitions (slower but comprehensive)
Sourcepub fn query_partitions(
&self,
partition_ids: &[&str],
query: Query,
limit: usize,
) -> Result<Vec<Neighbor>>
pub fn query_partitions( &self, partition_ids: &[&str], query: Query, limit: usize, ) -> Result<Vec<Neighbor>>
Query across specific partitions
Sourcepub fn delete(&mut self, partition_id: &str, id: &str) -> Result<()>
pub fn delete(&mut self, partition_id: &str, id: &str) -> Result<()>
Delete a vector from a partition
Sourcepub fn get_partition_info(&self, partition_id: &str) -> Option<&PartitionInfo>
pub fn get_partition_info(&self, partition_id: &str) -> Option<&PartitionInfo>
Get partition information
Sourcepub fn list_partitions(&self) -> Vec<&PartitionInfo>
pub fn list_partitions(&self) -> Vec<&PartitionInfo>
List all partitions
Sourcepub fn total_vectors(&self) -> usize
pub fn total_vectors(&self) -> usize
Get total vector count across all partitions
Sourcepub fn delete_partition(&mut self, partition_id: &str) -> Result<()>
pub fn delete_partition(&mut self, partition_id: &str) -> Result<()>
Delete a partition
Sourcepub fn compact_partition(&mut self, partition_id: &str) -> Result<usize>
pub fn compact_partition(&mut self, partition_id: &str) -> Result<usize>
Compact a partition (remove deleted vectors)
Sourcepub fn partition_stats(&self) -> PartitionStats
pub fn partition_stats(&self) -> PartitionStats
Get partition statistics
Auto Trait Implementations§
impl Freeze for PartitionedStore
impl !RefUnwindSafe for PartitionedStore
impl Send for PartitionedStore
impl Sync for PartitionedStore
impl Unpin for PartitionedStore
impl !UnwindSafe for PartitionedStore
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