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
Alternatively, you can https://forums.couchbase.com/t/replacing-field-name-prefix/28786[rename the existing fields] using a {sqlpp_url}[{sqlpp} (formerly N1QL)] statement.
206
-
207
-
WARNING: In SDK 2, only top-level fields could be encrypted.
208
-
SDK 3 allows encrypting fields at any depth.
209
-
If you decide to rename the existing fields, make sure to do so _before_ writing any encrypted fields below the top level, otherwise it may be difficult to rename the nested fields using a generic {sqlpp} statement.
210
-
211
-
212
-
[#configure-legacy-decrypters]
213
-
=== Enabling decrypters for legacy algorithms
214
-
215
-
The encryption algorithms used by SDK 2 are deprecated, and are no longer used for encrypting new data.
216
-
To enable decrypting fields written by SDK 2, register the legacy decrypters when configuring the `CryptoManager`:
Copy file name to clipboardExpand all lines: modules/howtos/pages/vector-searching-with-sdk.adoc
+122-8Lines changed: 122 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,18 +43,125 @@ Hybrid searches can combine Vector, geo-spatial search, range search, and tradit
43
43
////
44
44
45
45
46
-
This is currently implemented using xref:full-text-searching-with-sdk.adoc[Search Indexes], and can even be combined with traditional full text search queries.
47
-
Vector embeddings can be an array of floats or a xref:server:vector-search:run-vector-search-ui.adoc#base64[base64 encoded string].
46
+
Vector Search has been available in Couchbase Capella Operational and self-managed Server since version 7.6, using the COuchbase Server Search Service.
47
+
Version 8.0 introduces vector query using Global Secondary Indexes (GSI), the query index --
48
+
using either a fast Hyperscale index, or a composite index to combine scala queries with semantic search.
49
+
50
+
For fast and scalable vector query, use one of the GSI choices -- detailed in the next section.
51
+
If you don't require the scale of vector query with GSI, or need combined searches, then consider {#vector-search-with-the-search-service}.
52
+
53
+
54
+
55
+
== Vector Search With the Query Service and GSI
56
+
57
+
From the SDK, a vector query using GSI is the same as any other query.
58
+
However, you will need to build one or more indexes.
59
+
60
+
=== Prerequisites
61
+
62
+
Couchbase Server 8.0.0 or newer -- or a recent Capella instance.
63
+
64
+
Your chosen xref:server:vector-index:use-vector-indexes.adoc[vector index] --
65
+
hyperscale or composite.
66
+
67
+
68
+
=== Examples
69
+
70
+
These examples simply take the {sqlpp} queries shown in the
71
+
xref:server:vector-index:composite-vector-index.html#examples[Composite Index] and
72
+
xref:server:vector-index:hyperscale-vector-index.html#query-example[Hyperscale Index] example pages,
QueryResult result = cluster.query(SELECT RAW OBJECT_PUT(d, "embedding_vector_dot",ARRAY_CONCAT(d.embedding_vector_dot[0:4], ["..."])) FROM `vector-sample`.`color`.`rgb` AS d USE KEYS ["#FFEFD5"]);
final QueryResult result = cluster.query("SELECT d.id, d.question, d.wanted_similar_color_from_search, ARRAY_CONCAT(d.couchbase_search_query.knn[0].vector[0:4], ["..."]) AS vector FROM `vector-sample`.`color`.`rgb-questions` AS d WHERE d.id = "#87CEEB",
Vector search is also implemented using xref:full-text-searching-with-sdk.adoc[Search Indexes], and can be combined with traditional full text search queries.
155
+
Vector embeddings can be an array of floats or a xref:server:vector-search:run-vector-search-ui.adoc#base64[base64 encoded string].
156
+
157
+
=== Prerequisites
51
158
52
159
Couchbase Server 7.6.0
53
160
(7.6.2 for base64-encoded vectors) -- or recent Capella instance.
54
161
55
-
== Examples
162
+
=== Examples
56
163
57
-
=== Single vector query
164
+
==== Single vector query
58
165
59
166
In this first example we are performing a single vector query:
60
167
@@ -80,7 +187,7 @@ If it was a global index we would use `cluster.search()` instead - see <<Scoped
80
187
81
188
It returns the same `SearchResult` detailed earlier.
* xref:server:vector-search:vector-search.adoc[Vector Search for AI Apps docs (self-managed Couchbase Server)]
129
243
* xref:cloud::vector-search:vector-search.adoc[Vector Search for AI Apps docs (Capella DBaaS)]
130
244
* Vector Search in the https://docs.couchbase.com/sdk-api/couchbase-java-client/com/couchbase/client/java/search/vector/VectorSearch.html[Java API reference].
0 commit comments