pub trait VectorSetCommands<'a> {
Show 13 methods
// Provided methods
fn vadd<K, E>(
self,
key: K,
reduce_dim: Option<usize>,
values: &[f32],
element: E,
options: VAddOptions,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg,
E: SingleArg { ... }
fn vcard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg { ... }
fn vdim<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
where Self: Sized,
K: SingleArg { ... }
fn vemb<K, E, R>(self, key: K, element: E) -> PreparedCommand<'a, Self, R>
where Self: Sized,
K: SingleArg,
E: SingleArg,
R: CollectionResponse<f32> { ... }
fn vgetattr<K, E, R>(
self,
key: K,
element: E,
) -> PreparedCommand<'a, Self, R>
where Self: Sized,
K: SingleArg,
E: SingleArg,
R: Response { ... }
fn vinfo<K>(self, key: K) -> PreparedCommand<'a, Self, VInfoResult>
where Self: Sized,
K: SingleArg { ... }
fn vlinks<K, E, R, RR>(
self,
key: K,
element: E,
) -> PreparedCommand<'a, Self, RR>
where Self: Sized,
K: SingleArg,
E: SingleArg,
R: Response + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned { ... }
fn vlinks_with_score<K, E, R, RR>(
self,
key: K,
element: E,
) -> PreparedCommand<'a, Self, RR>
where Self: Sized,
K: SingleArg,
E: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: KeyValueCollectionResponse<R, f64> + DeserializeOwned { ... }
fn vrandmember<K, R, RR>(
self,
key: K,
count: isize,
) -> PreparedCommand<'a, Self, RR>
where Self: Sized,
K: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned { ... }
fn vrem<K, E>(self, key: K, element: E) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg,
E: SingleArg { ... }
fn vsetattr<K, E, J>(
self,
key: K,
element: E,
json: J,
) -> PreparedCommand<'a, Self, bool>
where Self: Sized,
K: SingleArg,
E: SingleArg,
J: SingleArg { ... }
fn vsim<K, R, RR>(
self,
key: K,
vector_or_element: VectorOrElement<'_>,
options: VSimOptions,
) -> PreparedCommand<'a, Self, RR>
where Self: Sized,
K: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned { ... }
fn vsim_with_scores<K, RF, R>(
self,
key: K,
vector_or_element: VectorOrElement<'_>,
options: VSimOptions,
) -> PreparedCommand<'a, Self, R>
where Self: Sized,
K: SingleArg,
RF: PrimitiveResponse + DeserializeOwned,
R: KeyValueCollectionResponse<RF, f64> + DeserializeOwned { ... }
}
Expand description
Provided Methods§
Sourcefn vadd<K, E>(
self,
key: K,
reduce_dim: Option<usize>,
values: &[f32],
element: E,
options: VAddOptions,
) -> PreparedCommand<'a, Self, bool>
fn vadd<K, E>( self, key: K, reduce_dim: Option<usize>, values: &[f32], element: E, options: VAddOptions, ) -> PreparedCommand<'a, Self, bool>
Add a new element into the vector set specified by key.
The vector can be provided as 32-bit floating point (FP32) blob of values, or as floating point numbers as strings
§Arguments
key
- is the name of the key that will hold the vector set data.reduce_dim
- implements random projection to reduce the dimensionality of the vector. The projection matrix is saved and reloaded along with the vector set.values
- vector values.element
- is the name of the element that is being added to the vector set.
§Return
true
- if key was added.false
- if key was not added.
§See Also
Sourcefn vcard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
fn vcard<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
Return the number of elements in the specified vector set.
§See Also
Sourcefn vdim<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
fn vdim<K>(self, key: K) -> PreparedCommand<'a, Self, usize>
Return the number of dimensions of the vectors in the specified vector set.
§See Also
Sourcefn vemb<K, E, R>(self, key: K, element: E) -> PreparedCommand<'a, Self, R>
fn vemb<K, E, R>(self, key: K, element: E) -> PreparedCommand<'a, Self, R>
Return the approximate vector associated with a given element in the vector set.
§See Also
Sourcefn vgetattr<K, E, R>(self, key: K, element: E) -> PreparedCommand<'a, Self, R>
fn vgetattr<K, E, R>(self, key: K, element: E) -> PreparedCommand<'a, Self, R>
Return the JSON attributes associated with an element in a vector set.
§See Also
Sourcefn vinfo<K>(self, key: K) -> PreparedCommand<'a, Self, VInfoResult>
fn vinfo<K>(self, key: K) -> PreparedCommand<'a, Self, VInfoResult>
Return metadata and internal details about a vector set, including size, dimensions, quantization type, and graph structure.
§See Also
Sourcefn vlinks<K, E, R, RR>(
self,
key: K,
element: E,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
E: SingleArg,
R: Response + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned,
fn vlinks<K, E, R, RR>(
self,
key: K,
element: E,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
E: SingleArg,
R: Response + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned,
Sourcefn vlinks_with_score<K, E, R, RR>(
self,
key: K,
element: E,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
E: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: KeyValueCollectionResponse<R, f64> + DeserializeOwned,
fn vlinks_with_score<K, E, R, RR>(
self,
key: K,
element: E,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
E: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: KeyValueCollectionResponse<R, f64> + DeserializeOwned,
Sourcefn vrandmember<K, R, RR>(
self,
key: K,
count: isize,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned,
fn vrandmember<K, R, RR>(
self,
key: K,
count: isize,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned,
Return one or more random elements from a vector set.
The behavior is similar to the SRANDMEMBER command:
- When called without a count, returns a single element as a bulk string.
- When called with a positive count, returns up to that many distinct elements (no duplicates).
- When called with a negative count, returns that many elements, possibly with duplicates.
- If the count exceeds the number of elements, the entire set is returned.
- If the key does not exist, the command returns null if no count is given, or an empty array if a count is provided.
§Return
a collecton containing the names of count random elements as strings.
§See Also
Sourcefn vrem<K, E>(self, key: K, element: E) -> PreparedCommand<'a, Self, bool>
fn vrem<K, E>(self, key: K, element: E) -> PreparedCommand<'a, Self, bool>
Remove an element from a vector set.
§Return
true
- if the element was removed.false
- if either element or key do not exist.
VREM reclaims memory immediately. It does not use tombstones or logical deletions, making it safe to use in long-running applications that frequently update the same vector set.
§See Also
Sourcefn vsetattr<K, E, J>(
self,
key: K,
element: E,
json: J,
) -> PreparedCommand<'a, Self, bool>
fn vsetattr<K, E, J>( self, key: K, element: E, json: J, ) -> PreparedCommand<'a, Self, bool>
Associate a JSON object with an element in a vector set.
Use this command to store attributes that can be used in filtered similarity searches with VSIM.
You can also update existing attributes or delete them by setting an empty string.
§See Also
Sourcefn vsim<K, R, RR>(
self,
key: K,
vector_or_element: VectorOrElement<'_>,
options: VSimOptions,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned,
fn vsim<K, R, RR>(
self,
key: K,
vector_or_element: VectorOrElement<'_>,
options: VSimOptions,
) -> PreparedCommand<'a, Self, RR>where
Self: Sized,
K: SingleArg,
R: PrimitiveResponse + DeserializeOwned,
RR: CollectionResponse<R> + DeserializeOwned,
Return elements similar to a given vector or element. Use this command to perform approximate or exact similarity searches within a vector set.
§See Also
Sourcefn vsim_with_scores<K, RF, R>(
self,
key: K,
vector_or_element: VectorOrElement<'_>,
options: VSimOptions,
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
K: SingleArg,
RF: PrimitiveResponse + DeserializeOwned,
R: KeyValueCollectionResponse<RF, f64> + DeserializeOwned,
fn vsim_with_scores<K, RF, R>(
self,
key: K,
vector_or_element: VectorOrElement<'_>,
options: VSimOptions,
) -> PreparedCommand<'a, Self, R>where
Self: Sized,
K: SingleArg,
RF: PrimitiveResponse + DeserializeOwned,
R: KeyValueCollectionResponse<RF, f64> + DeserializeOwned,
Return elements similar to a given vector or element. Use this command to perform approximate or exact similarity searches within a vector set.