From e5a1827ce87b38b850cc7584049304235f86bb28 Mon Sep 17 00:00:00 2001 From: "David W. Dougherty" Date: Thu, 24 Jul 2025 09:49:19 -0700 Subject: [PATCH 1/4] DOC-5495: modify vector set docs for 8.2 (initial commit) --- content/commands/vismember.md | 66 +++++++++++++++++++ content/commands/vrem.md | 4 +- content/commands/vsim.md | 4 ++ .../develop/data-types/vector-sets/_index.md | 1 + 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 content/commands/vismember.md diff --git a/content/commands/vismember.md b/content/commands/vismember.md new file mode 100644 index 0000000000..28e28ebf64 --- /dev/null +++ b/content/commands/vismember.md @@ -0,0 +1,66 @@ +--- +arguments: +- name: key + type: key +- name: element + type: string +arity: 3 +categories: +- docs +- develop +- stack +- oss +- rs +- rc +- oss +- kubernetes +- clients +command_flags: +- READONLY +complexity: O(1) +description: Check if an element exists in a vector set. +function: vismemberCommand +group: vector_set +hidden: false +linkTitle: VISMEMBER +since: 8.0.0 +summary: Check if an element exists in a vector set. +syntax_fmt: VISMEMBER key element +syntax_str: element +title: VISMEMBER +bannerText: Vector set is a new data type that is currently in preview and may be subject to change. +--- + +Check if an element exists in a vector set. + +## Required arguments + +
+key + +is the name of the key that holds the vector set. +
+ +
+element + +is the name of the element you want to check for membership. +
+ +## Return information + +{{< multitabs id="vismember-return-info" + tab1="RESP2" + tab2="RESP3" >}} + +[Integer reply](../../develop/reference/protocol-spec#integers): `0` if the element does not exist in the vector set, or the key does not exist. `1` if the element exists in the vector set. + +-tab-sep- + +[Boolean reply](../../develop/reference/protocol-spec#booleans): `false` if the element does not exist in the vector set, or the key does not exist. `true` if the element exists in the vector set. + +{{< /multitabs >}} + +## Related topics + +- [Vector sets]({{< relref "/develop/data-types/vector-sets" >}}) \ No newline at end of file diff --git a/content/commands/vrem.md b/content/commands/vrem.md index 444692b059..bf74d384d2 100644 --- a/content/commands/vrem.md +++ b/content/commands/vrem.md @@ -10,12 +10,12 @@ categories: - kubernetes - clients complexity: O(log(N)) for each element removed, where N is the number of elements in the vector set. -description: Remove one or more elements from a vector set. +description: Remove an element from a vector set. group: vector_set hidden: false linkTitle: VREM since: 8.0.0 -summary: Remove one or more elements from a vector set. +summary: Remove an element from a vector set. syntax_fmt: "VREM key element" title: VREM bannerText: Vector set is a new data type that is currently in preview and may be subject to change. diff --git a/content/commands/vsim.md b/content/commands/vsim.md index 9853b5c93c..288845787b 100644 --- a/content/commands/vsim.md +++ b/content/commands/vsim.md @@ -19,7 +19,11 @@ history: linkTitle: VSIM since: 8.0.0 summary: Return elements by vector similarity. +<<<<<<< Updated upstream syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]" +======= +syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [COUNT num] [EF search-exploration-factor]\n [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD] [EPSILON]" +>>>>>>> Stashed changes title: VSIM bannerText: Vector set is a new data type that is currently in preview and may be subject to change. --- diff --git a/content/develop/data-types/vector-sets/_index.md b/content/develop/data-types/vector-sets/_index.md index f654418ff6..f730a52f60 100644 --- a/content/develop/data-types/vector-sets/_index.md +++ b/content/develop/data-types/vector-sets/_index.md @@ -33,6 +33,7 @@ The following commands are available for vector sets: - [VEMB]({{< relref "/commands/vemb" >}}) - retrieve the approximate vector associated with a vector set element. - [VGETATTR]({{< relref "/commands/vgetattr" >}}) - retrieve the attributes of a vector set element. - [VINFO]({{< relref "/commands/vinfo" >}}) - retrieve metadata and internal details about a vector set, including size, dimensions, quantization type, and graph structure. +- [VISMEMBER]({{< relref "/commands/vismember" >}}) - check if an element exists in a vector set. - [VLINKS]({{< relref "/commands/vlinks" >}}) - retrieve the neighbors of a specified element in a vector set; the connections for each layer of the HNSW graph. - [VRANDMEMBER]({{< relref "/commands/vrandmember" >}}) - retrieve random elements of a vector set. - [VREM]({{< relref "/commands/vrem" >}}) - remove an element from a vector set. From ae6eccb99075f89c469527c1f6211e2095aa4d49 Mon Sep 17 00:00:00 2001 From: "David W. Dougherty" Date: Thu, 24 Jul 2025 13:54:08 -0700 Subject: [PATCH 2/4] Remove merge info --- content/commands/vsim.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/content/commands/vsim.md b/content/commands/vsim.md index 288845787b..fbf1ddf8a0 100644 --- a/content/commands/vsim.md +++ b/content/commands/vsim.md @@ -19,11 +19,7 @@ history: linkTitle: VSIM since: 8.0.0 summary: Return elements by vector similarity. -<<<<<<< Updated upstream -syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD]" -======= -syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [COUNT num] [EF search-exploration-factor]\n [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD] [EPSILON]" ->>>>>>> Stashed changes +syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD] [EPSILON]" title: VSIM bannerText: Vector set is a new data type that is currently in preview and may be subject to change. --- From ca332fa8b3cee96d9452158cd3d82430788c89d8 Mon Sep 17 00:00:00 2001 From: "David W. Dougherty" Date: Mon, 28 Jul 2025 07:06:08 -0700 Subject: [PATCH 3/4] Added EPSILON info --- content/commands/vsim.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/commands/vsim.md b/content/commands/vsim.md index fbf1ddf8a0..f2b5c9d36f 100644 --- a/content/commands/vsim.md +++ b/content/commands/vsim.md @@ -19,7 +19,7 @@ history: linkTitle: VSIM since: 8.0.0 summary: Return elements by vector similarity. -syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort] [TRUTH] [NOTHREAD] [EPSILON]" +syntax_fmt: "VSIM key (ELE | FP32 | VALUES num) (vector | element) [WITHSCORES] [WITHATTRIBS] [COUNT num]\n [EPSILON delta] [EF search-exploration-factor] [FILTER expression] [FILTER-EF max-filtering-effort]\n [TRUTH] [NOTHREAD]" title: VSIM bannerText: Vector set is a new data type that is currently in preview and may be subject to change. --- @@ -99,6 +99,12 @@ returns, for each element, the JSON attribute associated with the element or NUL limits the number of returned results to `num`. +
+EPSILON delta + +is a floating point number between 0 and 1. It is used to retrieve elements that have a distance that is no further than the specified `delta`. In vector sets, returned elements have a similarity score (when compared to the query vector) that is between 1 and 0, where 1 means identical and 0 means opposite vectors. For example, if the `EPSILON` option is specified with an argument of `0.2`, it means only elements that have a similarity of 0.8 or better (a distance < 0.2) are returned. This is useful when a large `COUNT` is specified, but you don't want elements that are too far away the query vector. +
+
EF search-exploration-factor From 3ca5f5b34b735e34f327f61e7e3d06c02d94d182 Mon Sep 17 00:00:00 2001 From: "David W. Dougherty" Date: Mon, 28 Jul 2025 07:39:01 -0700 Subject: [PATCH 4/4] Apply code review suggestions --- content/commands/vismember.md | 8 ++++---- content/commands/vrem.md | 4 ---- content/commands/vsim.md | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/content/commands/vismember.md b/content/commands/vismember.md index 28e28ebf64..4093d1e32f 100644 --- a/content/commands/vismember.md +++ b/content/commands/vismember.md @@ -47,6 +47,10 @@ is the name of the key that holds the vector set. is the name of the element you want to check for membership.
+## Related topics + +- [Vector sets]({{< relref "/develop/data-types/vector-sets" >}}) + ## Return information {{< multitabs id="vismember-return-info" @@ -60,7 +64,3 @@ is the name of the element you want to check for membership. [Boolean reply](../../develop/reference/protocol-spec#booleans): `false` if the element does not exist in the vector set, or the key does not exist. `true` if the element exists in the vector set. {{< /multitabs >}} - -## Related topics - -- [Vector sets]({{< relref "/develop/data-types/vector-sets" >}}) \ No newline at end of file diff --git a/content/commands/vrem.md b/content/commands/vrem.md index bf74d384d2..227c1e65e2 100644 --- a/content/commands/vrem.md +++ b/content/commands/vrem.md @@ -26,14 +26,10 @@ Remove an element from a vector set. ```shell VADD vset VALUES 3 1 0 1 bar (integer) 1 -``` -```shell VREM vset bar (integer) 1 -``` -```shell VREM vset bar (integer) 0 ``` diff --git a/content/commands/vsim.md b/content/commands/vsim.md index f2b5c9d36f..78a568a3c8 100644 --- a/content/commands/vsim.md +++ b/content/commands/vsim.md @@ -102,7 +102,7 @@ limits the number of returned results to `num`.
EPSILON delta -is a floating point number between 0 and 1. It is used to retrieve elements that have a distance that is no further than the specified `delta`. In vector sets, returned elements have a similarity score (when compared to the query vector) that is between 1 and 0, where 1 means identical and 0 means opposite vectors. For example, if the `EPSILON` option is specified with an argument of `0.2`, it means only elements that have a similarity of 0.8 or better (a distance < 0.2) are returned. This is useful when a large `COUNT` is specified, but you don't want elements that are too far away the query vector. +is a floating point number between 0 and 1. It is used to retrieve elements that have a distance that is no further than the specified `delta`. In vector sets, returned elements have a similarity score (when compared to the query vector) that is between 1 and 0, where 1 means identical and 0 means opposite vectors. For example, if the `EPSILON` option is specified with an argument of `0.2`, it means only elements that have a similarity of 0.8 or better (a distance < 0.2) are returned. This is useful when you specify a large `COUNT`, but you don't want elements that are too far away from the query vector.