Interface RVectorSet

All Superinterfaces:
RExpirable, RExpirableAsync, RObject, RObjectAsync, RVectorSetAsync
All Known Implementing Classes:
RedissonVectorSet

public interface RVectorSet extends RExpirable, RVectorSetAsync
Vector Set

Requires Redis 8.0.0 or higher.

Author:
Nikita Koksharov
  • Method Details

    • add

      boolean add(VectorAddArgs args)
      Adds an element
      Parameters:
      args - add arguments
      Returns:
      true if element was added and false if 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

      List<Double> getVector(String name)
      Retrieves approximate vector associated with a given element name
      Parameters:
      name - element name
      Returns:
      list of vector coordinates
    • getRawVector

      List<Object> getRawVector(String name)
      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

      <T> T getAttributes(String name, Class<T> clazz)
      Retrieves attributes associated with a given element name
      Parameters:
      name - element name
      clazz - type for deserialization
      Returns:
      attributes
    • getInfo

      VectorInfo getInfo()
      Returns metadata for this vector set
      Returns:
      vector set information
    • getNeighbors

      List<String> getNeighbors(String element)
      Retrieves the neighbors of a specified element by name
      Parameters:
      element - element name
      Returns:
      list of neighbor element names
    • getNeighborEntries

      List<ScoredEntry<String>> getNeighborEntries(String element)
      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

      List<String> random(int count)
      Returns random element names
      Parameters:
      count - number of elements to return
      Returns:
      list of random element names
    • remove

      boolean remove(String element)
      Removes an element by name
      Parameters:
      element - element name to remove
      Returns:
      true if element was removed, false otherwise
    • setAttributes

      boolean setAttributes(String element, Object attributes)
      Sets attributes for an element by name
      Parameters:
      element - element name
      attributes - attributes
      Returns:
      true if attributes were set, false otherwise
    • getSimilar

      List<String> getSimilar(VectorSimilarArgs args)
      Retrieves element names similar to a specified vector or element
      Parameters:
      args - vector similarity arguments
      Returns:
      list of similar element names
    • getSimilarEntries

      List<ScoredEntry<String>> getSimilarEntries(VectorSimilarArgs args)
      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

      List<ScoreAttributesEntry<String>> getSimilarEntriesWithAttributes(VectorSimilarArgs args)
      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