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
Copy file name to clipboardExpand all lines: modules/howtos/pages/vector-searching-with-sdk.adoc
+19-97Lines changed: 19 additions & 97 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
= Vector Search
2
2
:page-toclevels: 2
3
-
:description: Vector Search from the SDK, to enable AI integration, semantic search, and the RAG framework.
3
+
:description: Vector Search from the SDK, to enable AI integration, semantic search, and use of RAG frameworks.
4
4
5
5
6
6
// Note to editors
7
7
//
8
-
// This page pulls in content from -sdk-common-
9
-
// and code samples from -example-dir-
8
+
// This page pulls in content from -sdk-common-??
9
+
// and code samples https://github.com/couchbase/docs-sdk-java/tree/release/3.9/modules/devguide/examples/java/SimpleVectorQuery.java
10
+
// and https://github.com/couchbase/docs-sdk-java/tree/release/3.9/modules/devguide/examples/java/Search.java
10
11
//
11
-
// It can be seen built at wwww.
12
+
// It can be seen built at https://docs.couchbase.com/java-sdk/3.9/howtos/vector-searching-with-sdk.html
12
13
13
14
14
15
[abstract]
@@ -36,19 +37,12 @@ A Vector Search database includes:
36
37
37
38
38
39
39
-
////
40
-
Vector queries with GSI are fast and scale up, but sometimes you may wish to use Vector with the Search Service instead.
41
-
42
-
Hybrid searches can combine Vector, geo-spatial search, range search, and traditional fuzzy text search for apps that...........
43
-
////
44
-
45
-
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
-
Server version 8.0 introduces vector query using Global Secondary Indexes (GSI), the query index --
40
+
Vector Search has been available in Couchbase Capella Operational and self-managed Server since version 7.6, using the Couchbase Search Service.
41
+
Version 8.0 introduces vector query using Global Secondary Indexes (GSI), the Query Service index --
48
42
using either a fast Hyperscale index, or a composite index to combine scalar queries with semantic search.
49
43
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>>.
44
+
For fast and scalable vector queries, use one of the above two GSI choices -- detailed in the next section.
45
+
If you don't require the speed and scale of vector query with GSI, or need to combine vector, geo-spatial search, range search, and traditional fuzzy text searches, then consider {#vector-search-with-the-search-service}.
52
46
53
47
54
48
== Vector Search With the Query Service and GSI
@@ -58,106 +52,34 @@ However, you will need to build one or more indexes.
58
52
59
53
=== Prerequisites
60
54
61
-
Couchbase Server 8.0.0 or newer -- or a recent Capella instance.
55
+
*Couchbase Server 8.0.0 or newer -- or a recent Capella instance.
62
56
63
-
Your chosen xref:server:vector-index:use-vector-indexes.adoc[vector index] --
57
+
* Your chosen xref:server:vector-index:use-vector-indexes.adoc[vector index] --
64
58
hyperscale or composite.
65
59
66
60
67
-
=== Examples
61
+
You will need to refer to the xref:server/current/vector-index/vectors-and-indexes-overview.adoc[] pages for a full discussion of using Vector Indexes with Vector Queries.
62
+
In particular, you will need to xref:server:vector-index:hyperscale-filter.adoc#creating-a-hyperscale-vector-index-with-included-scalar-values[create a Vector Index].
68
63
69
-
These examples simply take the {sqlpp} queries shown in the
70
-
xref:server:vector-index:composite-vector-index.html#examples[Composite Index] and
71
-
xref:server:vector-index:hyperscale-vector-index.html#query-example[Hyperscale Index] example pages,
72
-
wrapped inside the {name-sdk} Query API.
73
64
74
65
66
+
=== Examples
75
67
68
+
The xref:server/current/vector-index/vectors-and-indexes-overview.adoc[] pages contain examples using both hyperscale and compound indexes.
76
69
70
+
Here is the xref:server:vector-index:hyperscale-vector-index.adoc#query-example[Hyperscale Index] example,
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",
0 commit comments