PointStore

Struct PointStore 

Source
pub struct PointStore<E: StorageEngine> { /* private fields */ }
Expand description

A store for points with multiple named vectors.

PointStore provides CRUD operations for points organized into named collections. Each point can have multiple named vectors (dense, sparse, or multi-vector) and a JSON payload.

Implementations§

Source§

impl<E: StorageEngine> PointStore<E>

Source

pub const fn new(engine: E) -> Self

Create a new point store with the given storage engine.

Source

pub fn engine(&self) -> &E

Get a reference to the storage engine.

Source

pub fn create_collection( &self, name: &CollectionName, schema: CollectionSchema, ) -> Result<(), VectorError>

Create a new collection.

§Errors

Returns an error if the collection already exists or if the storage operation fails.

Source

pub fn get_collection( &self, name: &CollectionName, ) -> Result<Collection, VectorError>

Get a collection by name.

§Errors

Returns an error if the collection doesn’t exist or if the storage operation fails.

Source

pub fn delete_collection( &self, name: &CollectionName, ) -> Result<(), VectorError>

Delete a collection and all its points.

§Errors

Returns an error if the collection doesn’t exist or if the storage operation fails.

Source

pub fn list_collections(&self) -> Result<Vec<Collection>, VectorError>

List all collections.

§Errors

Returns an error if the storage operation fails.

Source

pub fn collection_exists( &self, name: &CollectionName, ) -> Result<bool, VectorError>

Check if a collection exists.

§Errors

Returns an error if the storage operation fails.

Source

pub fn upsert_point( &self, collection_name: &CollectionName, point_id: PointId, payload: Payload, vectors: HashMap<String, NamedVector>, ) -> Result<(), VectorError>

Upsert a point (insert or update).

This operation will:

  • Insert the point if it doesn’t exist
  • Update the point if it exists, replacing payload and specified vectors
  • Vectors not specified in this call are left unchanged
§Errors

Returns an error if:

  • The collection doesn’t exist
  • A vector type doesn’t match the schema
  • A vector dimension doesn’t match the schema
  • The storage operation fails
Source

pub fn insert_point( &self, collection_name: &CollectionName, point_id: PointId, payload: Payload, vectors: HashMap<String, NamedVector>, ) -> Result<(), VectorError>

Insert a point. Fails if the point already exists.

§Errors

Returns an error if the point already exists, the collection doesn’t exist, or the storage operation fails.

Source

pub fn get_payload( &self, collection_name: &CollectionName, point_id: PointId, ) -> Result<Payload, VectorError>

Get a point’s payload.

§Errors

Returns an error if the point doesn’t exist or the storage operation fails.

Source

pub fn get_vector( &self, collection_name: &CollectionName, point_id: PointId, vector_name: &str, ) -> Result<NamedVector, VectorError>

Get a specific vector from a point.

§Errors

Returns an error if the vector doesn’t exist or the storage operation fails.

Source

pub fn get_all_vectors( &self, collection_name: &CollectionName, point_id: PointId, ) -> Result<HashMap<String, NamedVector>, VectorError>

Get all vectors for a point.

§Errors

Returns an error if the storage operation fails.

Source

pub fn update_payload( &self, collection_name: &CollectionName, point_id: PointId, payload: Payload, ) -> Result<(), VectorError>

Update a point’s payload without touching vectors.

§Errors

Returns an error if the point doesn’t exist or the storage operation fails.

Source

pub fn update_vector( &self, collection_name: &CollectionName, point_id: PointId, vector_name: &str, vector: NamedVector, ) -> Result<(), VectorError>

Update a specific vector without touching the payload or other vectors.

§Errors

Returns an error if the collection doesn’t exist or the storage operation fails.

Source

pub fn delete_point( &self, collection_name: &CollectionName, point_id: PointId, ) -> Result<bool, VectorError>

Delete a point and all its vectors.

§Returns

Returns Ok(true) if the point was deleted, Ok(false) if it didn’t exist.

§Errors

Returns an error if the storage operation fails.

Source

pub fn delete_vector( &self, collection_name: &CollectionName, point_id: PointId, vector_name: &str, ) -> Result<bool, VectorError>

Delete a specific vector from a point.

§Returns

Returns Ok(true) if the vector was deleted, Ok(false) if it didn’t exist.

§Errors

Returns an error if the storage operation fails.

Source

pub fn point_exists( &self, collection_name: &CollectionName, point_id: PointId, ) -> Result<bool, VectorError>

Check if a point exists.

§Errors

Returns an error if the storage operation fails.

Source

pub fn list_points( &self, collection_name: &CollectionName, ) -> Result<Vec<PointId>, VectorError>

List all point IDs in a collection.

§Errors

Returns an error if the storage operation fails.

Source

pub fn count_points( &self, collection_name: &CollectionName, ) -> Result<usize, VectorError>

Count the number of points in a collection.

§Errors

Returns an error if the storage operation fails.

Source

pub fn get_points( &self, collection_name: &CollectionName, point_ids: &[PointId], ) -> Result<Vec<(PointId, Option<Payload>)>, VectorError>

Get multiple points at once.

§Errors

Returns an error if the storage operation fails.

Auto Trait Implementations§

§

impl<E> Freeze for PointStore<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for PointStore<E>
where E: RefUnwindSafe,

§

impl<E> Send for PointStore<E>

§

impl<E> Sync for PointStore<E>

§

impl<E> Unpin for PointStore<E>
where E: Unpin,

§

impl<E> UnwindSafe for PointStore<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more