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
The Search Service allows you to create, manage and query full-text indexes on JSON documents stored in Couchbase buckets.
9
+
The Search Service allows you to create, manage and query Search indexes on JSON documents stored in Couchbase buckets.
10
10
It uses natural language processing for indexing and querying documents, provides relevance scoring on the results of your queries and has fast indexes for querying a wide range of possible text searches.
11
11
12
12
Some of the supported query-types include simple queries like Match and Term queries, range queries like Date Range and Numeric Range and compound queries for conjunctions, disjunctions and/or boolean queries.
@@ -20,10 +20,10 @@ After familiarizing yourself with how to create and query a Search index in the
20
20
There are two APIs for querying search: `cluster.searchQuery()`, and `cluster.search()`.
21
21
Both are also available at the Scope level.
22
22
23
-
The former API supports FTS queries (`SearchQuery`), while the latter additionally supports the `VectorSearch` added in 7.6.
23
+
The former API supports Search queries (`SearchQuery`), while the latter additionally supports the `VectorSearch` added in 7.6.
24
24
Most of this documentation will focus on the former API, as the latter is in @Stability.Volatile status.
25
25
26
-
We will perform an FTS query here - see the xref:vector-searching-with-sdk.adoc[Vector Search] docs for examples of Vector and xref:vector-searching-with-sdk.adoc#combining-fts-and-vector-queries[combining Vector and FTS].
26
+
We will perform a Search query here -- see the xref:vector-searching-with-sdk.adoc[Vector Search] docs for examples of Vector and xref:vector-searching-with-sdk.adoc#combining-fts-and-vector-queries[combining Vector and Search queries].
27
27
28
28
[source,java]
29
29
----
@@ -99,7 +99,7 @@ The `SearchRow` contains the following methods:
99
99
.SearchRow
100
100
[options="header"]
101
101
|====
102
-
| `index()` | The name of the FTS index that gave this result.
102
+
| `index()` | The name of the Search index that gave this result.
103
103
| `id()` | The id of the matching document.
104
104
| `score()` | The score of this hit.
105
105
| `explanation()` | If enabled provides an explanation in JSON form.
@@ -115,20 +115,20 @@ so if you absolutely need to check if all partitions are present in the result d
115
115
(and not only catch an exception on the query itself).
116
116
117
117
== Scoped vs Global Indexes
118
-
The FTS APIs exist at both the `Cluster` and `Scope` levels.
118
+
The Search APIs exist at both the `Cluster` and `Scope` levels.
119
119
120
-
This is because FTS supports, as of Couchbase Server 7.6, a new form of "scoped index" in addition to the traditional "global index".
120
+
This is because the Search Service supports, as of Couchbase Server 7.6, a new form of "scoped index" in addition to the traditional "global index".
121
121
122
122
It's important to use the `Cluster.searchQuery()` or `Cluster.search()` for global indexes, and `Scope.search()` for scoped indexes.
123
123
124
124
125
125
////
126
126
== Vector Search
127
-
As of Couchbase Server 7.6, the FTS service supports vector search in additional to traditional full text search queries.
127
+
As of Couchbase Server 7.6, the Search Service supports vector search in additional to traditional search queries.
128
128
// todo link to the server docs when available
129
129
130
130
=== Examples
131
-
==== Single vector query
131
+
==== Single Vector Query
132
132
In this first example we are performing a single vector query:
We create a `SearchRequest`, which can contain a traditional FTS query `SearchQuery` and/or the new `VectorSearch`.
140
+
We create a `SearchRequest`, which can contain a traditional Search query `SearchQuery` and/or the new `VectorSearch`.
141
141
Here we are just using the latter.
142
142
143
143
The `VectorSearch` allows us to perform one or more `VectorQuery` s.
@@ -146,14 +146,14 @@ The `VectorQuery` itself takes the name of the document field that contains embe
146
146
147
147
(Note that Couchbase itself is not involved in generating the vectors, and these will come from an external source such as an embeddings API.)
148
148
149
-
Finally we execute the `SearchRequest` against the FTS index "travel-sample-index", which has previously been setup to vector index the "vector_field" field.
149
+
Finally we execute the `SearchRequest` against the Search index "travel-sample-index", which has previously been setup to vector index the "vector_field" field.
150
150
151
151
This happens to be a scoped index so we are using `scope.search()`.
152
152
If it was a global index we would use `cluster.search()` instead - see <<Scoped vs Global Indexes>>.
153
153
154
154
It returns the same `SearchResult` detailed earlier.
However, it is possible to store non-JSON documents, such as raw binary data, perhaps using an concise binary encoding like https://msgpack.org[MessagePack] or https://cbor.io/[CBOR], in the Key-Value store.
140
140
141
-
NOTE: It's important to note that the Couchbase Data Platform includes multiple components other than the Key-Value store -- including {sqlpp_url}[{sqlpp} (formerly N1QL)] and its indexes, FTS, analytics, and eventing -- and these are optimized for JSON and will either ignore or provide limited functionality with non-JSON documents.
141
+
NOTE: It's important to note that the Couchbase Data Platform includes multiple components other than the Key-Value store -- including {sqlpp_url}[{sqlpp} (formerly N1QL)] and its Indexes, Search Service, Analytics, and Eventing -- and these are optimized for JSON and will either ignore or provide limited functionality with non-JSON documents.
142
142
143
143
Also note that some simple data types can be stored directly as JSON, without recourse to non-JSON transcoding.
144
144
A valid JSON document can be a simple integer (`42`), string (`"hello"`), array (`[1,2,3]`), boolean (`true`, `false`) and the JSON `null` value.
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.
91
+
Vector search is also implemented using xref:full-text-searching-with-sdk.adoc[Search Indexes], and can be combined with traditional search queries.
92
92
Vector embeddings can be an array of floats or a xref:server:vector-search:run-vector-search-ui.adoc#base64[base64 encoded string].
We create a `SearchRequest`, which can contain a traditional FTS query `SearchQuery` and/or the new `VectorSearch`.
111
+
We create a `SearchRequest`, which can contain a traditional s Search query `SearchQuery` and/or the new `VectorSearch`.
112
112
Here we are just using the latter.
113
113
114
114
The `VectorSearch` allows us to perform one or more `VectorQuery` s.
@@ -117,7 +117,7 @@ The `VectorQuery` itself takes the name of the document field that contains embe
117
117
118
118
(Note that Couchbase itself is not involved in generating the vectors, and these will come from an external source such as an embeddings API.)
119
119
120
-
Finally we execute the `SearchRequest` against the FTS index "travel-sample-index", which has previously been setup to vector index the "vector_field" field.
120
+
Finally we execute the `SearchRequest` against the Search index "travel-sample-index", which has previously been setup to vector index the "vector_field" field.
121
121
122
122
This happens to be a scoped index so we are using `scope.search()`.
123
123
If it was a global index we would use `cluster.search()` instead - see <<Scoped vs Global Indexes>>.
0 commit comments