Package org.redisson.api
Interface RVectorSet
- All Superinterfaces:
RExpirable,RExpirableAsync,RObject,RObjectAsync,RVectorSetAsync
- All Known Implementing Classes:
RedissonVectorSet
Vector Set
Requires Redis 8.0.0 or higher.
- Author:
- Nikita Koksharov
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(VectorAddArgs args) Adds an elementintReturns the number of dimensions of vectors<T> TgetAttributes(String name, Class<T> clazz) Retrieves attributes associated with a given element namegetInfo()Returns metadata for this vector setgetNeighborEntries(String element) Retrieves the neighbors with scores of a specified element by namegetNeighbors(String element) Retrieves the neighbors of a specified element by namegetRawVector(String name) Retrieves raw internal representation of the approximate vector associated with a given element namegetSimilar(VectorSimilarArgs args) Retrieves element names similar to a specified vector or elementRetrieves element names with scores similar to a given vector or elementRetrieves element names with scores and attributes similar to a given vector or elementRetrieves approximate vector associated with a given element namerandom()Returns a random element namerandom(int count) Returns random element namesbooleanRemoves an element by namebooleansetAttributes(String element, Object attributes) Sets attributes for an element by nameintsize()Returns the number of elementsMethods inherited from interface org.redisson.api.RExpirable
clearExpire, expire, expire, expire, expireAt, expireAt, expireIfGreater, expireIfGreater, expireIfLess, expireIfLess, expireIfNotSet, expireIfNotSet, expireIfSet, expireIfSet, getExpireTime, remainTimeToLiveMethods inherited from interface org.redisson.api.RExpirableAsync
clearExpireAsync, expireAsync, expireAsync, expireAsync, expireAtAsync, expireAtAsync, expireIfGreaterAsync, expireIfGreaterAsync, expireIfLessAsync, expireIfLessAsync, expireIfNotSetAsync, expireIfNotSetAsync, expireIfSetAsync, expireIfSetAsync, getExpireTimeAsync, remainTimeToLiveAsyncMethods inherited from interface org.redisson.api.RObject
addListener, copy, copy, copy, copyAndReplace, copyAndReplace, delete, dump, getAccessFrequency, getCodec, getIdleTime, getInternalEncoding, getName, getReferenceCount, isExists, migrate, move, removeListener, rename, renamenx, restore, restore, restoreAndReplace, restoreAndReplace, sizeInMemory, touch, unlinkMethods inherited from interface org.redisson.api.RObjectAsync
addListenerAsync, copyAndReplaceAsync, copyAndReplaceAsync, copyAsync, copyAsync, copyAsync, deleteAsync, dumpAsync, getAccessFrequencyAsync, getIdleTimeAsync, getInternalEncodingAsync, getReferenceCountAsync, isExistsAsync, migrateAsync, moveAsync, removeListenerAsync, renameAsync, renamenxAsync, restoreAndReplaceAsync, restoreAndReplaceAsync, restoreAsync, restoreAsync, sizeInMemoryAsync, touchAsync, unlinkAsyncMethods inherited from interface org.redisson.api.RVectorSetAsync
addAsync, dimensionsAsync, getAttributesAsync, getInfoAsync, getNeighborEntriesAsync, getNeighborsAsync, getRawVectorAsync, getSimilarAsync, getSimilarEntriesAsync, getSimilarEntriesWithAttributesAsync, getVectorAsync, randomAsync, randomAsync, removeAsync, setAttributesAsync, sizeAsync
-
Method Details
-
add
Adds an element- Parameters:
args- add arguments- Returns:
trueif element was added andfalseif updated
-
size
int size()Returns the number of elements- Returns:
- number of elements
-
dimensions
int dimensions()Returns the number of dimensions of vectors- Returns:
- dimensions count
-
getVector
Retrieves approximate vector associated with a given element name- Parameters:
name- element name- Returns:
- list of vector coordinates
-
getRawVector
Retrieves raw internal representation of the approximate vector associated with a given element name- Parameters:
name- element name- Returns:
- list of raw vector values
-
getAttributes
Retrieves attributes associated with a given element name- Parameters:
name- element nameclazz- type for deserialization- Returns:
- attributes
-
getInfo
VectorInfo getInfo()Returns metadata for this vector set- Returns:
- vector set information
-
getNeighbors
Retrieves the neighbors of a specified element by name- Parameters:
element- element name- Returns:
- list of neighbor element names
-
getNeighborEntries
Retrieves the neighbors with scores of a specified element by name- Parameters:
element- element name- Returns:
- list of neighbor elements with scores
-
random
String random()Returns a random element name- Returns:
- random element name
-
random
Returns random element names- Parameters:
count- number of elements to return- Returns:
- list of random element names
-
remove
Removes an element by name- Parameters:
element- element name to remove- Returns:
trueif element was removed,falseotherwise
-
setAttributes
Sets attributes for an element by name- Parameters:
element- element nameattributes- attributes- Returns:
trueif attributes were set,falseotherwise
-
getSimilar
Retrieves element names similar to a specified vector or element- Parameters:
args- vector similarity arguments- Returns:
- list of similar element names
-
getSimilarEntries
Retrieves element names with scores similar to a given vector or element- Parameters:
args- similarity arguments- Returns:
- list of similar element names with scores
-
getSimilarEntriesWithAttributes
Retrieves element names with scores and attributes similar to a given vector or element- Parameters:
args- similarity arguments- Returns:
- list of similar element names with scores and attributes
-