VLINKS

Syntax
VLINKS key element [WITHSCORES]
Available since:
Redis CE 8.0.0
Time complexity:
O(1)

Return the neighbors of a specified element in a vector set. The command shows the connections for each layer of the HNSW graph.

VLINKS key element

Use the WITHSCORES option to include similarity scores for each neighbor.

VLINKS key element WITHSCORES

Required arguments

key

is the name of the key that holds the vector set.

element

is the name of the element whose HNSW neighbors you want to inspect.

Optional arguments

WITHSCORES

includes similarity scores for each neighbor.

RESP2 Reply

One of the following:

  • Array reply containing the names of adjacent elements as strings; interleved with scores when using the WITHSCORES option.
  • Bulk string reply (null bulk string) for unknown keys and/or elements.

RESP3 Reply

One of the following:

  • Array reply containing the names of adjacent elements as strings when used without the WITHSCORES option.
  • Map reply containing the names of adjecent elements as strings, together with their scores as doubles when used with the WITHSCORES option.
  • Null reply for unknown keys and/or elements.

RATE THIS PAGE
Back to top ↑