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>
impl<E: StorageEngine> PointStore<E>
Sourcepub fn create_collection(
&self,
name: &CollectionName,
schema: CollectionSchema,
) -> Result<(), VectorError>
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.
Sourcepub fn get_collection(
&self,
name: &CollectionName,
) -> Result<Collection, VectorError>
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.
Sourcepub fn delete_collection(
&self,
name: &CollectionName,
) -> Result<(), VectorError>
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.
Sourcepub fn list_collections(&self) -> Result<Vec<Collection>, VectorError>
pub fn list_collections(&self) -> Result<Vec<Collection>, VectorError>
Sourcepub fn collection_exists(
&self,
name: &CollectionName,
) -> Result<bool, VectorError>
pub fn collection_exists( &self, name: &CollectionName, ) -> Result<bool, VectorError>
Sourcepub fn upsert_point(
&self,
collection_name: &CollectionName,
point_id: PointId,
payload: Payload,
vectors: HashMap<String, NamedVector>,
) -> Result<(), VectorError>
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
Sourcepub fn insert_point(
&self,
collection_name: &CollectionName,
point_id: PointId,
payload: Payload,
vectors: HashMap<String, NamedVector>,
) -> Result<(), VectorError>
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.
Sourcepub fn get_payload(
&self,
collection_name: &CollectionName,
point_id: PointId,
) -> Result<Payload, VectorError>
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.
Sourcepub fn get_vector(
&self,
collection_name: &CollectionName,
point_id: PointId,
vector_name: &str,
) -> Result<NamedVector, VectorError>
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.
Sourcepub fn get_all_vectors(
&self,
collection_name: &CollectionName,
point_id: PointId,
) -> Result<HashMap<String, NamedVector>, VectorError>
pub fn get_all_vectors( &self, collection_name: &CollectionName, point_id: PointId, ) -> Result<HashMap<String, NamedVector>, VectorError>
Sourcepub fn update_payload(
&self,
collection_name: &CollectionName,
point_id: PointId,
payload: Payload,
) -> Result<(), VectorError>
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.
Sourcepub fn update_vector(
&self,
collection_name: &CollectionName,
point_id: PointId,
vector_name: &str,
vector: NamedVector,
) -> Result<(), VectorError>
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.
Sourcepub fn delete_point(
&self,
collection_name: &CollectionName,
point_id: PointId,
) -> Result<bool, VectorError>
pub fn delete_point( &self, collection_name: &CollectionName, point_id: PointId, ) -> Result<bool, VectorError>
Sourcepub fn delete_vector(
&self,
collection_name: &CollectionName,
point_id: PointId,
vector_name: &str,
) -> Result<bool, VectorError>
pub fn delete_vector( &self, collection_name: &CollectionName, point_id: PointId, vector_name: &str, ) -> Result<bool, VectorError>
Sourcepub fn point_exists(
&self,
collection_name: &CollectionName,
point_id: PointId,
) -> Result<bool, VectorError>
pub fn point_exists( &self, collection_name: &CollectionName, point_id: PointId, ) -> Result<bool, VectorError>
Sourcepub fn list_points(
&self,
collection_name: &CollectionName,
) -> Result<Vec<PointId>, VectorError>
pub fn list_points( &self, collection_name: &CollectionName, ) -> Result<Vec<PointId>, VectorError>
Sourcepub fn count_points(
&self,
collection_name: &CollectionName,
) -> Result<usize, VectorError>
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.