pub struct QdrantOps { /* private fields */ }Expand description
Thin wrapper over Qdrant client encapsulating common collection operations.
Implementations§
Source§impl QdrantOps
impl QdrantOps
Sourcepub fn new(url: &str) -> Result<Self, Box<QdrantError>>
pub fn new(url: &str) -> Result<Self, Box<QdrantError>>
Create a new QdrantOps connected to the given URL.
§Errors
Returns an error if the Qdrant client cannot be created.
Sourcepub async fn ensure_collection(
&self,
collection: &str,
vector_size: u64,
) -> Result<(), Box<QdrantError>>
pub async fn ensure_collection( &self, collection: &str, vector_size: u64, ) -> Result<(), Box<QdrantError>>
Ensure a collection exists with cosine distance vectors.
Idempotent: no-op if the collection already exists.
§Errors
Returns an error if Qdrant cannot be reached or collection creation fails.
Sourcepub async fn collection_exists(
&self,
collection: &str,
) -> Result<bool, Box<QdrantError>>
pub async fn collection_exists( &self, collection: &str, ) -> Result<bool, Box<QdrantError>>
Sourcepub async fn delete_collection(
&self,
collection: &str,
) -> Result<(), Box<QdrantError>>
pub async fn delete_collection( &self, collection: &str, ) -> Result<(), Box<QdrantError>>
Sourcepub async fn upsert(
&self,
collection: &str,
points: Vec<PointStruct>,
) -> Result<(), Box<QdrantError>>
pub async fn upsert( &self, collection: &str, points: Vec<PointStruct>, ) -> Result<(), Box<QdrantError>>
Sourcepub async fn search(
&self,
collection: &str,
vector: Vec<f32>,
limit: u64,
filter: Option<Filter>,
) -> Result<Vec<ScoredPoint>, Box<QdrantError>>
pub async fn search( &self, collection: &str, vector: Vec<f32>, limit: u64, filter: Option<Filter>, ) -> Result<Vec<ScoredPoint>, Box<QdrantError>>
Search for similar vectors, returning scored points with payloads.
§Errors
Returns an error if the search fails.
Sourcepub async fn delete_by_ids(
&self,
collection: &str,
ids: Vec<PointId>,
) -> Result<(), Box<QdrantError>>
pub async fn delete_by_ids( &self, collection: &str, ids: Vec<PointId>, ) -> Result<(), Box<QdrantError>>
Sourcepub async fn scroll_all(
&self,
collection: &str,
key_field: &str,
) -> Result<HashMap<String, HashMap<String, String>>, Box<QdrantError>>
pub async fn scroll_all( &self, collection: &str, key_field: &str, ) -> Result<HashMap<String, HashMap<String, String>>, Box<QdrantError>>
Scroll all points in a collection, extracting string payload fields.
Returns a map of key_field value -> { field_name -> field_value }.
§Errors
Returns an error if the scroll operation fails.
Sourcepub async fn ensure_collection_with_quantization(
&self,
collection: &str,
vector_size: u64,
keyword_fields: &[&str],
) -> Result<(), VectorStoreError>
pub async fn ensure_collection_with_quantization( &self, collection: &str, vector_size: u64, keyword_fields: &[&str], ) -> Result<(), VectorStoreError>
Create a collection with scalar INT8 quantization if it does not exist, then create keyword indexes for the given fields.
Idempotent: no-op if the collection already exists.
§Errors
Returns an error if any Qdrant operation fails.
Trait Implementations§
Source§impl VectorStore for QdrantOps
impl VectorStore for QdrantOps
fn ensure_collection( &self, collection: &str, vector_size: u64, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn collection_exists( &self, collection: &str, ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>
fn delete_collection( &self, collection: &str, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn upsert( &self, collection: &str, points: Vec<VectorPoint>, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn search( &self, collection: &str, vector: Vec<f32>, limit: u64, filter: Option<VectorFilter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredVectorPoint>, VectorStoreError>> + Send + '_>>
fn delete_by_ids( &self, collection: &str, ids: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>
fn scroll_all( &self, collection: &str, key_field: &str, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, HashMap<String, String>>, VectorStoreError>> + Send + '_>>
fn health_check( &self, ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>
Auto Trait Implementations§
impl Freeze for QdrantOps
impl !RefUnwindSafe for QdrantOps
impl Send for QdrantOps
impl Sync for QdrantOps
impl Unpin for QdrantOps
impl UnsafeUnpin for QdrantOps
impl !UnwindSafe for QdrantOps
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request