You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bannerText: Vector set is a new data type that is currently in preview and may be subject to change.
22
25
---
@@ -39,16 +42,19 @@ VSIM word_embeddings ELE apple
39
42
10) "grape"
40
43
```
41
44
42
-
You can include similarity scores and limit the number of results:
45
+
You can include similarity scores, attributes (if any), and limit the number of results:
43
46
44
47
```shell
45
-
VSIM word_embeddings ELE apple WITHSCORES COUNT 3
48
+
VSIM word_embeddings ELE apple WITHSCORES WITHATTRIBS COUNT 3
46
49
1) "apple"
47
50
2) "0.9998867657923256"
48
-
3) "apples"
49
-
4) "0.8598527610301971"
50
-
5) "pear"
51
-
6) "0.8226882219314575"
51
+
3) "{\"len\": 5}"
52
+
4) "apples"
53
+
5) "0.859852746129036"
54
+
6) "{\"len\": 6}"
55
+
7) "pear"
56
+
8) "0.8226882070302963"
57
+
9) "{\"len\": 4}"
52
58
```
53
59
54
60
Set the `EF` (exploration factor) to improve recall at the cost of performance. Use the `TRUTH` option to perform an exact linear scan, useful for benchmarking. The `NOTHREAD` option runs the search in the main thread and may increase server latency.
@@ -81,6 +87,12 @@ is either the vector data (for `FP32` or `VALUES`) or the name of the element (f
81
87
returns the similarity score (from 1 to 0) alongside each result. A score of 1 is identical; 0 is the opposite.
82
88
</details>
83
89
90
+
<detailsopen>
91
+
<summary><code>WITHATTRIBS</code></summary>
92
+
93
+
returns, for each element, the JSON attribute associated with the element or NULL when no attributes are present.
94
+
</details>
95
+
84
96
<detailsopen>
85
97
<summary><code>COUNT num</code></summary>
86
98
@@ -128,16 +140,19 @@ executes the search in the main thread instead of a background thread. Useful fo
128
140
tab2="RESP3" >}}
129
141
130
142
One of the following:
131
-
*[Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for unknown element.
132
-
*[Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown key.
133
-
*[Array reply](../../develop/reference/protocol-spec#arrays) with matching elements; juxtaposed with scores when used with the WITHSCORES option.
143
+
*[Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for an unknown element.
144
+
*[Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for an unknown key.
145
+
*[Array reply](../../develop/reference/protocol-spec#arrays) with matching elements.
146
+
* With the `WITHSCORES` option, an [array reply](../../develop/reference/protocol-spec#arrays) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements juxtaposed with [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) as floating-point scores.
147
+
* With the `WITHCORES` and `WITHATTRIBS` options, an [array reply](../../develop/reference/protocol-spec#arrays) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements, and two additional elements: (1) a [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) as floating-point score and (2) a [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) representing the JSON attribute associated with the element or [nil (null bulk string)]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) for the elements missing an attribute.
134
148
135
149
-tab-sep-
136
150
137
151
One of the following:
138
152
*[Simple error reply](../../develop/reference/protocol-spec/#simple-errors) for unknown element.
139
153
*[Array reply](../../develop/reference/protocol-spec#arrays) (empty array) for unknown key.
140
154
*[Array reply](../../develop/reference/protocol-spec#arrays) with matching elements.
141
-
*[Map reply](../../develop/reference/protocol-spec#maps) with matching elements and [double](../../develop/reference/protocol-spec#doubles) scores when used with the WITHSCORES option.
155
+
* With the `WITHSCORES` option, a [map reply](../../develop/reference/protocol-spec#maps) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements (keys) and [double](../../develop/reference/protocol-spec#doubles) scores (values).
156
+
* With the `WITHSCORES` and `WITHATTRIBS` options, a [Map reply](../../develop/reference/protocol-spec#maps) with matching [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) elements (keys), and an additional array (values) with the following elements: (1) a [double reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) for the score and (2) a [bulk string]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) representing the JSON attribute associated with the element or [null]({{< relref "/develop/reference/protocol-spec#nulls" >}}) for the elements missing an attribute.
0 commit comments