K
- Key type.V
- Value type.public class RedisVectorSetCommandBuilder<K,V> extends BaseRedisCommandBuilder<K,V>
BaseRedisCommandBuilder
handling Vector Set commands.codec, MINUS_BYTES, MUST_NOT_BE_EMPTY, MUST_NOT_BE_NULL, MUST_NOT_CONTAIN_NULL_ELEMENTS, PLUS_BYTES
Constructor and Description |
---|
RedisVectorSetCommandBuilder(RedisCodec<K,V> codec,
Supplier<JsonParser> parser)
Initialize a new
RedisVectorSetCommandBuilder with the specified codec. |
Modifier and Type | Method and Description |
---|---|
Command<K,V,Boolean> |
vadd(K key,
int dimensionality,
V element,
Double[] vectors)
Create a new
VADD command to add a vector to a vector set with the specified dimensionality. |
Command<K,V,Boolean> |
vadd(K key,
int dimensionality,
V element,
VAddArgs vAddArgs,
Double[] vectors)
Create a new
VADD command to add a vector to a vector set with the specified dimensionality and additional
options. |
Command<K,V,Boolean> |
vadd(K key,
V element,
Double[] vectors)
Create a new
VADD command to add a vector to a vector set. |
Command<K,V,Boolean> |
vadd(K key,
V element,
VAddArgs vAddArgs,
Double[] vectors)
Create a new
VADD command to add a vector to a vector set with additional options. |
Command<K,V,Long> |
vcard(K key)
Create a new
VCARD command to get the number of elements in a vector set. |
Command<K,V,Long> |
vdim(K key)
Create a new
VDIM command to get the dimensionality of a vector set. |
Command<K,V,List<Double>> |
vemb(K key,
V element)
Create a new
VEMB command to get the vector values for an element in a vector set. |
Command<K,V,RawVector> |
vembRaw(K key,
V element)
Create a new
VEMB command with the RAW option to get the raw binary vector data for an element in a vector set. |
Command<K,V,String> |
vgetattr(K key,
V element)
Create a new
VGETATTR command to get the attributes associated with an element in a vector set. |
Command<K,V,List<JsonValue>> |
vgetattrAsJsonValue(K key,
V element)
Create a new
VGETATTR command to get the attributes associated with an element in a vector set. |
Command<K,V,VectorMetadata> |
vinfo(K key)
Create a new
VINFO command to get information about a vector set. |
Command<K,V,List<V>> |
vlinks(K key,
V element)
Create a new
VLINKS command to get the links (connections) of an element in the HNSW graph. |
Command<K,V,Map<V,Double>> |
vlinksWithScores(K key,
V element)
Create a new
VLINKS command with the WITHSCORES option to get the links of an element along with their scores. |
Command<K,V,V> |
vrandmember(K key)
Create a new
VRANDMEMBER command to get a random element from a vector set. |
Command<K,V,List<V>> |
vrandmember(K key,
int count)
Create a new
VRANDMEMBER command to get multiple random elements from a vector set. |
Command<K,V,Boolean> |
vrem(K key,
V element)
Create a new
VREM command to remove an element from a vector set. |
Command<K,V,Boolean> |
vsetattr(K key,
V element,
JsonValue json)
Create a new
VSETATTR command to set or update the attributes for an element in a vector set. |
Command<K,V,Boolean> |
vsetattr(K key,
V element,
String json)
Create a new
VSETATTR command to set or update the attributes for an element in a vector set. |
Command<K,V,List<V>> |
vsim(K key,
Double[] vectors)
Create a new
VSIM command to find the most similar vectors to the given query vector in a vector set. |
Command<K,V,List<V>> |
vsim(K key,
V element)
Create a new
VSIM command to find the most similar vectors to the given element's vector in a vector set. |
Command<K,V,List<V>> |
vsim(K key,
VSimArgs vSimArgs,
Double[] vectors)
Create a new
VSIM command to find the most similar vectors to the given query vector in a vector set with
additional options. |
Command<K,V,List<V>> |
vsim(K key,
VSimArgs vSimArgs,
V element)
Create a new
VSIM command to find the most similar vectors to the given element's vector in a vector set with
additional options. |
Command<K,V,Map<V,Double>> |
vsimWithScore(K key,
Double[] vectors)
Create a new
VSIM command with the WITHSCORES option to find the most similar vectors to the given query vector
and return them with their similarity scores. |
Command<K,V,Map<V,Double>> |
vsimWithScore(K key,
V element)
Create a new
VSIM command with the WITHSCORES option to find the most similar vectors to the given element's
vector and return them with their similarity scores. |
Command<K,V,Map<V,Double>> |
vsimWithScore(K key,
VSimArgs vSimArgs,
Double[] vectors)
Create a new
VSIM command with the WITHSCORES option to find the most similar vectors to the given query vector
with additional options and return them with their similarity scores. |
Command<K,V,Map<V,Double>> |
vsimWithScore(K key,
VSimArgs vSimArgs,
V element)
Create a new
VSIM command with the WITHSCORES option to find the most similar vectors to the given element's
vector with additional options and return them with their similarity scores. |
addLimit, allElementsInstanceOf, assertNodeId, createCommand, createCommand, createCommand, createCommand, createCommand, keyAndFieldsProvided, max, maxValue, min, minValue, newScriptOutput, notEmpty, notEmptyRanges, notEmptySlots, notEmptyValues, notNull, notNull, notNull, notNull, notNullKey, notNullLimit, notNullMinMax, notNullRange
public RedisVectorSetCommandBuilder(RedisCodec<K,V> codec, Supplier<JsonParser> parser)
RedisVectorSetCommandBuilder
with the specified codec.codec
- the codec used to encode/decode keys and values, must not be null
parser
- public Command<K,V,Boolean> vadd(K key, V element, Double[] vectors)
VADD
command to add a vector to a vector set.key
- the key of the vector set, must not be null
element
- the name of the element being added to the vector set, must not be null
vectors
- the vector values as floating point numbers, must not be emptyCommand
that adds a vector to a vector setpublic Command<K,V,Boolean> vadd(K key, int dimensionality, V element, Double[] vectors)
VADD
command to add a vector to a vector set with the specified dimensionality.key
- the key of the vector set, must not be null
dimensionality
- the number of dimensions for the vectorelement
- the name of the element being added to the vector set, must not be null
vectors
- the vector values as floating point numbers, must not be emptyCommand
that adds a vector to a vector set with the specified dimensionalitypublic Command<K,V,Boolean> vadd(K key, V element, VAddArgs vAddArgs, Double[] vectors)
VADD
command to add a vector to a vector set with additional options.key
- the key of the vector set, must not be null
element
- the name of the element being added to the vector set, must not be null
vAddArgs
- the additional arguments for the VADD commandvectors
- the vector values as floating point numbers, must not be emptyCommand
that adds a vector to a vector set with additional optionspublic Command<K,V,Boolean> vadd(K key, int dimensionality, V element, VAddArgs vAddArgs, Double[] vectors)
VADD
command to add a vector to a vector set with the specified dimensionality and additional
options.key
- the key of the vector set, must not be null
dimensionality
- the number of dimensions for the vectorelement
- the name of the element being added to the vector set, must not be null
vAddArgs
- the additional arguments for the VADD commandvectors
- the vector values as floating point numbers, must not be emptyCommand
that adds a vector to a vector set with the specified dimensionality and additional optionspublic Command<K,V,Long> vcard(K key)
VCARD
command to get the number of elements in a vector set.key
- the key of the vector set, must not be null
Command
that returns the number of elements in the vector setpublic Command<K,V,Long> vdim(K key)
VDIM
command to get the dimensionality of a vector set.key
- the key of the vector set, must not be null
Command
that returns the dimensionality of the vector setpublic Command<K,V,List<Double>> vemb(K key, V element)
VEMB
command to get the vector values for an element in a vector set.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
Command
that returns the vector values for the specified elementpublic Command<K,V,RawVector> vembRaw(K key, V element)
VEMB
command with the RAW option to get the raw binary vector data for an element in a vector set.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
Command
that returns the raw vector data for the specified elementpublic Command<K,V,String> vgetattr(K key, V element)
VGETATTR
command to get the attributes associated with an element in a vector set.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
Command
that returns the attributes associated with the specified elementpublic Command<K,V,List<JsonValue>> vgetattrAsJsonValue(K key, V element)
VGETATTR
command to get the attributes associated with an element in a vector set.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
Command
that returns the attributes associated with the specified elementpublic Command<K,V,VectorMetadata> vinfo(K key)
VINFO
command to get information about a vector set.key
- the key of the vector set, must not be null
Command
that returns metadata about the vector setpublic Command<K,V,List<V>> vlinks(K key, V element)
VLINKS
command to get the links (connections) of an element in the HNSW graph.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
Command
that returns a list of elements that are linked to the specified elementpublic Command<K,V,Map<V,Double>> vlinksWithScores(K key, V element)
VLINKS
command with the WITHSCORES option to get the links of an element along with their scores.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
Command
that returns a list of elements with their similarity scorespublic Command<K,V,V> vrandmember(K key)
VRANDMEMBER
command to get a random element from a vector set.key
- the key of the vector set, must not be null
Command
that returns a random element from the vector setpublic Command<K,V,List<V>> vrandmember(K key, int count)
VRANDMEMBER
command to get multiple random elements from a vector set.key
- the key of the vector set, must not be null
count
- the number of random elements to returnCommand
that returns a list of random elements from the vector setpublic Command<K,V,Boolean> vrem(K key, V element)
VREM
command to remove an element from a vector set.key
- the key of the vector set, must not be null
element
- the name of the element to remove from the vector set, must not be null
Command
that returns true if the element was removed, false if the key or
element does not existpublic Command<K,V,Boolean> vsetattr(K key, V element, String json)
VSETATTR
command to set or update the attributes for an element in a vector set.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
json
- the attributes as a JSON string, must not be null
Command
that returns true if the attributes were set, false if the key or
element does not existpublic Command<K,V,Boolean> vsetattr(K key, V element, JsonValue json)
VSETATTR
command to set or update the attributes for an element in a vector set.key
- the key of the vector set, must not be null
element
- the name of the element in the vector set, must not be null
json
- the attributes as a JSON string, must not be null
Command
that returns true if the attributes were set, false if the key or
element does not existpublic Command<K,V,List<V>> vsim(K key, Double[] vectors)
VSIM
command to find the most similar vectors to the given query vector in a vector set.key
- the key of the vector set, must not be null
vectors
- the query vector values as floating point numbers, must not be emptyCommand
that returns a list of elements most similar to the query vectorpublic Command<K,V,List<V>> vsim(K key, V element)
VSIM
command to find the most similar vectors to the given element's vector in a vector set.key
- the key of the vector set, must not be null
element
- the name of the element whose vector will be used as the query, must not be null
Command
that returns a list of elements most similar to the specified elementpublic Command<K,V,List<V>> vsim(K key, VSimArgs vSimArgs, Double[] vectors)
VSIM
command to find the most similar vectors to the given query vector in a vector set with
additional options.key
- the key of the vector set, must not be null
vSimArgs
- the additional arguments for the VSIM commandvectors
- the query vector values as floating point numbers, must not be emptyCommand
that returns a list of elements most similar to the query vectorpublic Command<K,V,List<V>> vsim(K key, VSimArgs vSimArgs, V element)
VSIM
command to find the most similar vectors to the given element's vector in a vector set with
additional options.key
- the key of the vector set, must not be null
vSimArgs
- the additional arguments for the VSIM commandelement
- the name of the element whose vector will be used as the query, must not be null
Command
that returns a list of elements most similar to the specified elementpublic Command<K,V,Map<V,Double>> vsimWithScore(K key, Double[] vectors)
VSIM
command with the WITHSCORES option to find the most similar vectors to the given query vector
and return them with their similarity scores.key
- the key of the vector set, must not be null
vectors
- the query vector values as floating point numbers, must not be emptyCommand
that returns a map of elements to their similarity scorespublic Command<K,V,Map<V,Double>> vsimWithScore(K key, V element)
VSIM
command with the WITHSCORES option to find the most similar vectors to the given element's
vector and return them with their similarity scores.key
- the key of the vector set, must not be null
element
- the name of the element whose vector will be used as the query, must not be null
Command
that returns a map of elements to their similarity scorespublic Command<K,V,Map<V,Double>> vsimWithScore(K key, VSimArgs vSimArgs, Double[] vectors)
VSIM
command with the WITHSCORES option to find the most similar vectors to the given query vector
with additional options and return them with their similarity scores.key
- the key of the vector set, must not be null
vSimArgs
- the additional arguments for the VSIM commandvectors
- the query vector values as floating point numbers, must not be emptyCommand
that returns a map of elements to their similarity scorespublic Command<K,V,Map<V,Double>> vsimWithScore(K key, VSimArgs vSimArgs, V element)
VSIM
command with the WITHSCORES option to find the most similar vectors to the given element's
vector with additional options and return them with their similarity scores.key
- the key of the vector set, must not be null
vSimArgs
- the additional arguments for the VSIM commandelement
- the name of the element whose vector will be used as the query, must not be null
Command
that returns a map of elements to their similarity scoresCopyright © 2025 lettuce.io. All rights reserved.