pub struct ArroyWrapper { /* private fields */ }Implementations§
Source§impl ArroyWrapper
impl ArroyWrapper
pub fn new( database: Database<Unspecified>, embedder_index: u8, quantized: bool, ) -> Self
pub fn embedder_index(&self) -> u8
pub fn dimensions(&self, rtxn: &RoTxn<'_>) -> Result<usize, Error>
pub fn build_and_quantize<R: Rng + SeedableRng>( &mut self, wtxn: &mut RwTxn<'_>, progress: &Progress, rng: &mut R, dimension: usize, quantizing: bool, arroy_memory: Option<usize>, cancel: &(impl Fn() -> bool + Sync + Send), ) -> Result<(), Error>
Sourcepub fn add_items(
&self,
wtxn: &mut RwTxn<'_>,
item_id: ItemId,
embeddings: &Embeddings<f32>,
) -> Result<(), Error>
pub fn add_items( &self, wtxn: &mut RwTxn<'_>, item_id: ItemId, embeddings: &Embeddings<f32>, ) -> Result<(), Error>
Overwrite all the embeddings associated with the index and item ID.
/!\ It won’t remove embeddings after the last passed embedding, which can leave stale embeddings.
You should call del_items on the item_id before calling this method.
/!\ Cannot insert more than u8::MAX embeddings; after inserting u8::MAX embeddings, all the remaining ones will be silently ignored.
Sourcepub fn add_item(
&self,
wtxn: &mut RwTxn<'_>,
item_id: ItemId,
vector: &[f32],
) -> Result<(), Error>
pub fn add_item( &self, wtxn: &mut RwTxn<'_>, item_id: ItemId, vector: &[f32], ) -> Result<(), Error>
Add one document int for this index where we can find an empty spot.
Sourcepub fn del_items(
&self,
wtxn: &mut RwTxn<'_>,
dimension: usize,
item_id: ItemId,
) -> Result<(), Error>
pub fn del_items( &self, wtxn: &mut RwTxn<'_>, dimension: usize, item_id: ItemId, ) -> Result<(), Error>
Delete all embeddings from a specific item_id
Sourcepub fn del_item(
&self,
wtxn: &mut RwTxn<'_>,
item_id: ItemId,
vector: &[f32],
) -> Result<bool, Error>
pub fn del_item( &self, wtxn: &mut RwTxn<'_>, item_id: ItemId, vector: &[f32], ) -> Result<bool, Error>
Delete one item.
pub fn clear(&self, wtxn: &mut RwTxn<'_>, dimension: usize) -> Result<(), Error>
pub fn contains_item( &self, rtxn: &RoTxn<'_>, dimension: usize, item: ItemId, ) -> Result<bool, Error>
pub fn nns_by_item( &self, rtxn: &RoTxn<'_>, item: ItemId, limit: usize, filter: Option<&RoaringBitmap>, ) -> Result<Vec<(ItemId, f32)>, Error>
pub fn nns_by_vector( &self, rtxn: &RoTxn<'_>, vector: &[f32], limit: usize, filter: Option<&RoaringBitmap>, ) -> Result<Vec<(ItemId, f32)>, Error>
pub fn item_vectors( &self, rtxn: &RoTxn<'_>, item_id: u32, ) -> Result<Vec<Vec<f32>>, Error>
pub fn aggregate_stats( &self, rtxn: &RoTxn<'_>, stats: &mut ArroyStats, ) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for ArroyWrapper
impl RefUnwindSafe for ArroyWrapper
impl Send for ArroyWrapper
impl Sync for ArroyWrapper
impl Unpin for ArroyWrapper
impl UnwindSafe for ArroyWrapper
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