couchbase 4.2.9 → 4.2.11-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/deps/couchbase-cxx-client/CMakeLists.txt +4 -0
- package/deps/couchbase-cxx-client/cmake/CompilerWarnings.cmake +7 -3
- package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +1 -0
- package/deps/couchbase-cxx-client/core/bucket.cxx +67 -2
- package/deps/couchbase-cxx-client/core/bucket.hxx +2 -1
- package/deps/couchbase-cxx-client/core/cluster.cxx +65 -1
- package/deps/couchbase-cxx-client/core/impl/bucket.cxx +24 -0
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +73 -0
- package/deps/couchbase-cxx-client/core/impl/collection.cxx +2 -2
- package/deps/couchbase-cxx-client/core/impl/diagnostics.cxx +294 -0
- package/deps/couchbase-cxx-client/core/impl/diagnostics.hxx +39 -0
- package/deps/couchbase-cxx-client/core/impl/query_index_manager.cxx +6 -6
- package/deps/couchbase-cxx-client/core/impl/scope.cxx +19 -4
- package/deps/couchbase-cxx-client/core/impl/search.cxx +75 -2
- package/deps/couchbase-cxx-client/core/impl/search.hxx +8 -0
- package/deps/couchbase-cxx-client/core/impl/search_index_manager.cxx +261 -18
- package/deps/couchbase-cxx-client/core/impl/search_request.cxx +139 -0
- package/deps/couchbase-cxx-client/core/impl/vector_query.cxx +42 -0
- package/deps/couchbase-cxx-client/core/impl/vector_search.cxx +40 -0
- package/deps/couchbase-cxx-client/core/io/http_session.hxx +6 -3
- package/deps/couchbase-cxx-client/core/io/http_session_manager.hxx +7 -1
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +10 -0
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +48 -33
- package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +2 -0
- package/deps/couchbase-cxx-client/core/logger/logger.cxx +1 -1
- package/deps/couchbase-cxx-client/core/management/design_document.hxx +1 -1
- package/deps/couchbase-cxx-client/core/meta/features.hxx +26 -1
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_all_replicas.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/document_lookup_in_any_replica.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/document_query.cxx +8 -3
- package/deps/couchbase-cxx-client/core/operations/document_search.cxx +37 -1
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +11 -0
- package/deps/couchbase-cxx-client/core/operations/document_view.cxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/document_view.hxx +1 -0
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.cxx +7 -6
- package/deps/couchbase-cxx-client/core/operations/management/collection_create.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.cxx +7 -8
- package/deps/couchbase-cxx-client/core/operations/management/collection_update.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/error_utils.cxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.cxx +24 -13
- package/deps/couchbase-cxx-client/core/operations/management/query_index_create.hxx +1 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.cxx +17 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_analyze_document.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.cxx +21 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_ingest.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.cxx +21 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_plan_freeze.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.cxx +21 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_control_query.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.cxx +17 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_drop.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.cxx +17 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get.hxx +2 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.cxx +39 -22
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_all.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.cxx +18 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_get_documents_count.hxx +3 -0
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.cxx +17 -1
- package/deps/couchbase-cxx-client/core/operations/management/search_index_upsert.hxx +3 -0
- package/deps/couchbase-cxx-client/core/origin.cxx +14 -0
- package/deps/couchbase-cxx-client/core/origin.hxx +6 -0
- package/deps/couchbase-cxx-client/core/protocol/status.cxx +2 -0
- package/deps/couchbase-cxx-client/core/protocol/status.hxx +1 -0
- package/deps/couchbase-cxx-client/core/topology/capabilities.hxx +70 -1
- package/deps/couchbase-cxx-client/core/topology/capabilities_fmt.hxx +30 -2
- package/deps/couchbase-cxx-client/core/topology/collections_manifest.hxx +1 -1
- package/deps/couchbase-cxx-client/core/topology/collections_manifest_json.hxx +1 -1
- package/deps/couchbase-cxx-client/core/topology/configuration.hxx +1 -34
- package/deps/couchbase-cxx-client/core/topology/configuration_fmt.hxx +2 -2
- package/deps/couchbase-cxx-client/core/topology/configuration_json.hxx +43 -20
- package/deps/couchbase-cxx-client/core/transactions/internal/exceptions_internal.hxx +5 -0
- package/deps/couchbase-cxx-client/core/transactions/internal/utils.hxx +4 -0
- package/deps/couchbase-cxx-client/core/vector_query_combination.hxx +23 -0
- package/deps/couchbase-cxx-client/couchbase/bucket.hxx +29 -0
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +110 -0
- package/deps/couchbase-cxx-client/couchbase/codec/json_transcoder.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/codec/raw_binary_transcoder.hxx +2 -1
- package/deps/couchbase-cxx-client/couchbase/codec/raw_json_transcoder.hxx +78 -0
- package/deps/couchbase-cxx-client/couchbase/codec/raw_string_transcoder.hxx +72 -0
- package/deps/couchbase-cxx-client/couchbase/collection_query_index_manager.hxx +80 -11
- package/deps/couchbase-cxx-client/couchbase/create_collection_options.hxx +29 -1
- package/deps/couchbase-cxx-client/couchbase/diagnostics_options.hxx +75 -0
- package/deps/couchbase-cxx-client/couchbase/diagnostics_result.hxx +124 -0
- package/deps/couchbase-cxx-client/couchbase/endpoint_diagnostics.hxx +206 -0
- package/deps/couchbase-cxx-client/couchbase/endpoint_ping_report.hxx +205 -0
- package/deps/couchbase-cxx-client/couchbase/fmt/key_value_status_code.hxx +3 -1
- package/deps/couchbase-cxx-client/couchbase/get_options.hxx +1 -6
- package/deps/couchbase-cxx-client/couchbase/key_value_status_code.hxx +1 -0
- package/deps/couchbase-cxx-client/couchbase/management/collection_spec.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/ping_options.hxx +93 -0
- package/deps/couchbase-cxx-client/couchbase/ping_result.hxx +118 -0
- package/deps/couchbase-cxx-client/couchbase/query_index_manager.hxx +6 -8
- package/deps/couchbase-cxx-client/couchbase/scope.hxx +24 -8
- package/deps/couchbase-cxx-client/couchbase/scope_search_index_manager.hxx +291 -0
- package/deps/couchbase-cxx-client/couchbase/search_request.hxx +120 -0
- package/deps/couchbase-cxx-client/couchbase/service_type.hxx +58 -0
- package/deps/couchbase-cxx-client/couchbase/update_collection_options.hxx +32 -3
- package/deps/couchbase-cxx-client/couchbase/vector_query.hxx +99 -0
- package/deps/couchbase-cxx-client/couchbase/vector_search.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/vector_search_options.hxx +76 -0
- package/dist/binding.d.ts +33 -2
- package/dist/binding.js +4 -1
- package/dist/bindingutilities.d.ts +16 -3
- package/dist/bindingutilities.js +47 -7
- package/dist/cluster.d.ts +12 -1
- package/dist/cluster.js +22 -0
- package/dist/couchbase.d.ts +2 -0
- package/dist/couchbase.js +2 -0
- package/dist/queryindexmanager.d.ts +4 -4
- package/dist/queryindexmanager.js +7 -7
- package/dist/scope.d.ts +21 -0
- package/dist/scope.js +34 -0
- package/dist/scopesearchindexmanager.d.ts +116 -0
- package/dist/scopesearchindexmanager.js +406 -0
- package/dist/sdspecs.js +10 -9
- package/dist/sdutils.d.ts +1 -0
- package/dist/sdutils.js +4 -0
- package/dist/searchexecutor.d.ts +5 -3
- package/dist/searchexecutor.js +27 -4
- package/dist/searchindexmanager.d.ts +58 -3
- package/dist/searchindexmanager.js +188 -104
- package/dist/searchtypes.d.ts +46 -0
- package/dist/searchtypes.js +81 -1
- package/dist/vectorsearch.d.ts +99 -0
- package/dist/vectorsearch.js +132 -0
- package/dist/viewexecutor.js +13 -9
- package/dist/viewindexmanager.d.ts +70 -7
- package/dist/viewindexmanager.js +236 -103
- package/dist/viewtypes.d.ts +26 -0
- package/dist/viewtypes.js +17 -1
- package/package.json +7 -7
- package/src/constants.cpp +12 -0
- package/src/jstocbpp_autogen.hpp +113 -13
- package/tools/gen-bindings-json.py +2 -0
@@ -0,0 +1,205 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2023-present Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#pragma once
|
19
|
+
|
20
|
+
#include <chrono>
|
21
|
+
#include <cstdint>
|
22
|
+
#include <map>
|
23
|
+
#include <optional>
|
24
|
+
#include <string>
|
25
|
+
|
26
|
+
#include <couchbase/codec/tao_json_serializer.hxx>
|
27
|
+
#include <couchbase/endpoint_ping_report.hxx>
|
28
|
+
#include <couchbase/service_type.hxx>
|
29
|
+
|
30
|
+
namespace couchbase
|
31
|
+
{
|
32
|
+
enum class ping_state {
|
33
|
+
/**
|
34
|
+
* Indicates that the ping operation was successful.
|
35
|
+
*
|
36
|
+
* @since 1.0.0
|
37
|
+
* @committed
|
38
|
+
*/
|
39
|
+
ok,
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Indicates that the ping operation timed out.
|
43
|
+
*
|
44
|
+
* @since 1.0.0
|
45
|
+
* @committed
|
46
|
+
*/
|
47
|
+
timeout,
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Indicates that the ping operation failed.
|
51
|
+
*
|
52
|
+
* @since 1.0.0
|
53
|
+
* @committed
|
54
|
+
*/
|
55
|
+
error,
|
56
|
+
};
|
57
|
+
|
58
|
+
class endpoint_ping_report
|
59
|
+
{
|
60
|
+
public:
|
61
|
+
/**
|
62
|
+
* @since 1.0.0
|
63
|
+
* @internal
|
64
|
+
*/
|
65
|
+
endpoint_ping_report() = default;
|
66
|
+
|
67
|
+
/**
|
68
|
+
* @since 1.0.0
|
69
|
+
* @internal
|
70
|
+
*/
|
71
|
+
endpoint_ping_report(service_type type,
|
72
|
+
std::string id,
|
73
|
+
std::string local,
|
74
|
+
std::string remote,
|
75
|
+
ping_state state,
|
76
|
+
std::optional<std::string> error,
|
77
|
+
std::optional<std::string> endpoint_namespace,
|
78
|
+
std::chrono::microseconds latency)
|
79
|
+
: type_{ type }
|
80
|
+
, id_{ std::move(id) }
|
81
|
+
, local_{ std::move(local) }
|
82
|
+
, remote_{ std::move(remote) }
|
83
|
+
, state_{ state }
|
84
|
+
, error_{ std::move(error) }
|
85
|
+
, namespace_{ std::move(endpoint_namespace) }
|
86
|
+
, latency_{ latency }
|
87
|
+
{
|
88
|
+
}
|
89
|
+
|
90
|
+
/**
|
91
|
+
* Returns the service type for this endpoint.
|
92
|
+
*
|
93
|
+
* @return the service type.
|
94
|
+
*
|
95
|
+
* @since 1.0.0
|
96
|
+
* @committed
|
97
|
+
*/
|
98
|
+
[[nodiscard]] auto type() const -> service_type
|
99
|
+
{
|
100
|
+
return type_;
|
101
|
+
}
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Returns the ID for this endpoint.
|
105
|
+
*
|
106
|
+
* @return the endpoint ID.
|
107
|
+
*
|
108
|
+
* @since 1.0.0
|
109
|
+
* @committed
|
110
|
+
*/
|
111
|
+
[[nodiscard]] auto id() const -> std::string
|
112
|
+
{
|
113
|
+
return id_;
|
114
|
+
}
|
115
|
+
|
116
|
+
/**
|
117
|
+
* Returns the local socket address for this endpoint.
|
118
|
+
*
|
119
|
+
* @return the local socket address.
|
120
|
+
*
|
121
|
+
* @since 1.0.0
|
122
|
+
* @committed
|
123
|
+
*/
|
124
|
+
[[nodiscard]] auto local() const -> std::string
|
125
|
+
{
|
126
|
+
return local_;
|
127
|
+
}
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Returns the remote socket address for this endpoint.
|
131
|
+
*
|
132
|
+
* @return the remote socket address.
|
133
|
+
*
|
134
|
+
* @since 1.0.0
|
135
|
+
* @committed
|
136
|
+
*/
|
137
|
+
[[nodiscard]] auto remote() const -> std::string
|
138
|
+
{
|
139
|
+
return remote_;
|
140
|
+
}
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Returns the state of this ping when assembling the report.
|
144
|
+
*
|
145
|
+
* @return the ping state.
|
146
|
+
*
|
147
|
+
* @since 1.0.0
|
148
|
+
* @committed
|
149
|
+
*/
|
150
|
+
[[nodiscard]] auto state() const -> ping_state
|
151
|
+
{
|
152
|
+
return state_;
|
153
|
+
}
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Returns the reason this ping did not succeed, if applicable.
|
157
|
+
*
|
158
|
+
* @return error description.
|
159
|
+
*
|
160
|
+
* @since 1.0.0
|
161
|
+
* @committed
|
162
|
+
*/
|
163
|
+
[[nodiscard]] auto error() const -> std::optional<std::string>
|
164
|
+
{
|
165
|
+
return error_;
|
166
|
+
}
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Returns the namespace of this endpoint (likely the bucket name if present).
|
170
|
+
*
|
171
|
+
* @return the namespace.
|
172
|
+
*
|
173
|
+
* @since 1.0.0
|
174
|
+
* @committed
|
175
|
+
*/
|
176
|
+
[[nodiscard]] auto endpoint_namespace() const -> std::optional<std::string>
|
177
|
+
{
|
178
|
+
return namespace_;
|
179
|
+
}
|
180
|
+
|
181
|
+
/**
|
182
|
+
* Returns the latency of this ping.
|
183
|
+
*
|
184
|
+
* @return the latency in microseconds.
|
185
|
+
*
|
186
|
+
* @since 1.0.0
|
187
|
+
* @committed
|
188
|
+
*/
|
189
|
+
[[nodiscard]] auto latency() const -> std::chrono::microseconds
|
190
|
+
{
|
191
|
+
return latency_;
|
192
|
+
}
|
193
|
+
|
194
|
+
private:
|
195
|
+
service_type type_;
|
196
|
+
std::string id_;
|
197
|
+
std::string local_;
|
198
|
+
std::string remote_;
|
199
|
+
ping_state state_;
|
200
|
+
std::optional<std::string> error_{};
|
201
|
+
std::optional<std::string> namespace_{};
|
202
|
+
std::chrono::microseconds latency_;
|
203
|
+
};
|
204
|
+
|
205
|
+
} // namespace couchbase
|
@@ -257,7 +257,9 @@ struct fmt::formatter<couchbase::key_value_status_code> {
|
|
257
257
|
case key_value_status_code::range_scan_vb_uuid_not_equal:
|
258
258
|
name = "range_scan_vb_uuid_not_equal (0xa8)";
|
259
259
|
break;
|
260
|
-
|
260
|
+
case key_value_status_code::config_only:
|
261
|
+
name = "config_only (0x0d)";
|
262
|
+
break;
|
261
263
|
case key_value_status_code::unknown:
|
262
264
|
name = "unknown (0xffff)";
|
263
265
|
break;
|
@@ -46,8 +46,6 @@ struct get_options : public common_options<get_options> {
|
|
46
46
|
const std::vector<std::string> projections;
|
47
47
|
};
|
48
48
|
|
49
|
-
static constexpr std::size_t maximum_number_of_projections{ 16U };
|
50
|
-
|
51
49
|
/**
|
52
50
|
* Validates options and returns them as an immutable value.
|
53
51
|
*
|
@@ -60,10 +58,7 @@ struct get_options : public common_options<get_options> {
|
|
60
58
|
*/
|
61
59
|
[[nodiscard]] auto build() const -> built
|
62
60
|
{
|
63
|
-
|
64
|
-
return { build_common_options(), with_expiry_, projections_ };
|
65
|
-
}
|
66
|
-
return { build_common_options(), with_expiry_, {} };
|
61
|
+
return { build_common_options(), with_expiry_, projections_ };
|
67
62
|
}
|
68
63
|
|
69
64
|
/**
|
@@ -0,0 +1,93 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2023-Present Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#pragma once
|
19
|
+
|
20
|
+
#include <couchbase/common_options.hxx>
|
21
|
+
#include <couchbase/ping_result.hxx>
|
22
|
+
#include <couchbase/service_type.hxx>
|
23
|
+
|
24
|
+
#include <functional>
|
25
|
+
#include <memory>
|
26
|
+
#include <optional>
|
27
|
+
#include <set>
|
28
|
+
#include <string>
|
29
|
+
|
30
|
+
namespace couchbase
|
31
|
+
{
|
32
|
+
struct ping_options : public common_options<ping_options> {
|
33
|
+
/**
|
34
|
+
* Sets a custom report ID that will be used in the report. If no report ID is provided, the client will generate a
|
35
|
+
* unique one.
|
36
|
+
*
|
37
|
+
* @param report_id the report ID that should be used.
|
38
|
+
* @return reference to this object, for use in chaining.
|
39
|
+
*
|
40
|
+
* @since 1.0.0
|
41
|
+
* @committed
|
42
|
+
*/
|
43
|
+
auto report_id(std::string report_id) -> ping_options&
|
44
|
+
{
|
45
|
+
report_id_ = std::move(report_id);
|
46
|
+
return self();
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Customizes the set of services to ping.
|
51
|
+
*
|
52
|
+
* @param service_types the services to ping.
|
53
|
+
* @return reference to this object, for use in chaining.
|
54
|
+
*/
|
55
|
+
auto service_types(std::set<service_type> service_types) -> ping_options&
|
56
|
+
{
|
57
|
+
service_types_ = std::move(service_types);
|
58
|
+
return self();
|
59
|
+
}
|
60
|
+
|
61
|
+
/**
|
62
|
+
* Immutable value object representing consistent options.
|
63
|
+
*
|
64
|
+
* @since 1.0.0
|
65
|
+
* @internal
|
66
|
+
*/
|
67
|
+
struct built : public common_options<ping_options>::built {
|
68
|
+
std::optional<std::string> report_id;
|
69
|
+
std::set<service_type> service_types;
|
70
|
+
};
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Validates the options and returns them as an immutable value.
|
74
|
+
*
|
75
|
+
* @return consistent options as an immutable value
|
76
|
+
*
|
77
|
+
* @exception std::system_error with code errc::common::invalid_argument if the options are not valid
|
78
|
+
*
|
79
|
+
* @since 1.0.0
|
80
|
+
* @internal
|
81
|
+
*/
|
82
|
+
[[nodiscard]] auto build() const -> built
|
83
|
+
{
|
84
|
+
return { build_common_options(), report_id_, service_types_ };
|
85
|
+
}
|
86
|
+
|
87
|
+
private:
|
88
|
+
std::optional<std::string> report_id_{};
|
89
|
+
std::set<service_type> service_types_{};
|
90
|
+
};
|
91
|
+
|
92
|
+
using ping_handler = std::function<void(ping_result)>;
|
93
|
+
} // namespace couchbase
|
@@ -0,0 +1,118 @@
|
|
1
|
+
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright 2023-present Couchbase, Inc.
|
4
|
+
*
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
#pragma once
|
19
|
+
|
20
|
+
#include <couchbase/codec/tao_json_serializer.hxx>
|
21
|
+
#include <couchbase/endpoint_ping_report.hxx>
|
22
|
+
#include <couchbase/service_type.hxx>
|
23
|
+
|
24
|
+
#include <cstdint>
|
25
|
+
#include <map>
|
26
|
+
#include <string>
|
27
|
+
#include <utility>
|
28
|
+
#include <vector>
|
29
|
+
|
30
|
+
namespace couchbase
|
31
|
+
{
|
32
|
+
class ping_result
|
33
|
+
{
|
34
|
+
public:
|
35
|
+
/**
|
36
|
+
* @since 1.0.0
|
37
|
+
* @internal
|
38
|
+
*/
|
39
|
+
ping_result() = default;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* @since 1.0.0
|
43
|
+
* @internal
|
44
|
+
*/
|
45
|
+
ping_result(std::string id, std::uint16_t version, std::string sdk, std::map<service_type, std::vector<endpoint_ping_report>> endpoints)
|
46
|
+
: id_{ std::move(id) }
|
47
|
+
, version_{ version }
|
48
|
+
, sdk_{ std::move(sdk) }
|
49
|
+
, endpoints_{ std::move(endpoints) }
|
50
|
+
{
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Returns the ID of this report.
|
55
|
+
*
|
56
|
+
* @return the report ID.
|
57
|
+
*
|
58
|
+
* @since 1.0.0
|
59
|
+
* @committed
|
60
|
+
*/
|
61
|
+
[[nodiscard]] auto id() const -> std::string
|
62
|
+
{
|
63
|
+
return id_;
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* Returns the version of this report (useful when exporting to JSON).
|
68
|
+
*
|
69
|
+
* @return the report version.
|
70
|
+
*
|
71
|
+
* @since 1.0.0
|
72
|
+
* @committed
|
73
|
+
*/
|
74
|
+
[[nodiscard]] auto version() const -> std::uint16_t
|
75
|
+
{
|
76
|
+
return version_;
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Returns the identifier of this SDK (useful when exporting to JSON).
|
81
|
+
*
|
82
|
+
* @return the SDK identifier.
|
83
|
+
*
|
84
|
+
* @since 1.0.0
|
85
|
+
* @committed
|
86
|
+
*/
|
87
|
+
[[nodiscard]] auto sdk() const -> std::string
|
88
|
+
{
|
89
|
+
return sdk_;
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Returns the ping reports for each individual endpoint, organised by service type.
|
94
|
+
*
|
95
|
+
* @return the service type to ping reports map.
|
96
|
+
*
|
97
|
+
* @since 1.0.0
|
98
|
+
* @committed
|
99
|
+
*/
|
100
|
+
[[nodiscard]] auto endpoints() const -> std::map<service_type, std::vector<endpoint_ping_report>>
|
101
|
+
{
|
102
|
+
return endpoints_;
|
103
|
+
}
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Exports the ping report as JSON.
|
107
|
+
*
|
108
|
+
* @return the JSON report.
|
109
|
+
*/
|
110
|
+
[[nodiscard]] auto as_json() const -> codec::tao_json_serializer::document_type;
|
111
|
+
|
112
|
+
private:
|
113
|
+
std::string id_{};
|
114
|
+
std::uint16_t version_{};
|
115
|
+
std::string sdk_{};
|
116
|
+
std::map<service_type, std::vector<endpoint_ping_report>> endpoints_{};
|
117
|
+
};
|
118
|
+
} // namespace couchbase
|
@@ -51,7 +51,6 @@ class query_index_manager
|
|
51
51
|
/**
|
52
52
|
* Get all indexes within a bucket.
|
53
53
|
*
|
54
|
-
*
|
55
54
|
* @param bucket_name specifies the bucket in which we look for the indexes
|
56
55
|
* @param options optional parameters
|
57
56
|
* @param handler the handler that implements @ref get_all_query_indexes_handler
|
@@ -66,7 +65,6 @@ class query_index_manager
|
|
66
65
|
/**
|
67
66
|
* Get all indexes within a bucket.
|
68
67
|
*
|
69
|
-
*
|
70
68
|
* @param bucket_name specifies the bucket in which we look for the indexes
|
71
69
|
* @param options optional parameters
|
72
70
|
* @return future object that carries result of the operation
|
@@ -82,7 +80,7 @@ class query_index_manager
|
|
82
80
|
*
|
83
81
|
* @param bucket_name specifies the bucket in which to create the index
|
84
82
|
* @param index_name name of the index
|
85
|
-
* @param
|
83
|
+
* @param keys the keys to create the index over
|
86
84
|
* @param options optional parameters
|
87
85
|
* @param handler the handler that implements @ref create_query_index_handler
|
88
86
|
*
|
@@ -91,7 +89,7 @@ class query_index_manager
|
|
91
89
|
*/
|
92
90
|
void create_index(std::string bucket_name,
|
93
91
|
std::string index_name,
|
94
|
-
std::vector<std::string>
|
92
|
+
std::vector<std::string> keys,
|
95
93
|
const create_query_index_options& options,
|
96
94
|
create_query_index_handler&& handler) const;
|
97
95
|
|
@@ -100,7 +98,7 @@ class query_index_manager
|
|
100
98
|
*
|
101
99
|
* @param bucket_name specifies the bucket in which to create the index
|
102
100
|
* @param index_name name of the index
|
103
|
-
* @param
|
101
|
+
* @param keys the keys to create the index over
|
104
102
|
* @param options optional parameters
|
105
103
|
* @return future object that carries result of the operation
|
106
104
|
*
|
@@ -109,7 +107,7 @@ class query_index_manager
|
|
109
107
|
*/
|
110
108
|
[[nodiscard]] auto create_index(std::string bucket_name,
|
111
109
|
std::string index_name,
|
112
|
-
std::vector<std::string>
|
110
|
+
std::vector<std::string> keys,
|
113
111
|
const create_query_index_options& options) const -> std::future<manager_error_context>;
|
114
112
|
|
115
113
|
/**
|
@@ -202,7 +200,7 @@ class query_index_manager
|
|
202
200
|
* By default, this method will build the indexes on the bucket.
|
203
201
|
*
|
204
202
|
* @param bucket_name name of the bucket
|
205
|
-
* @param options
|
203
|
+
* @param options optional parameters
|
206
204
|
* @param handler the handler that implements @ref build_deferred_query_indexes_handler
|
207
205
|
*
|
208
206
|
* @since 1.0.0
|
@@ -218,7 +216,7 @@ class query_index_manager
|
|
218
216
|
* By default, this method will build the indexes on the bucket.
|
219
217
|
*
|
220
218
|
* @param bucket_name name of the bucket
|
221
|
-
* @param options
|
219
|
+
* @param options optional parameters
|
222
220
|
* @return future object that carries result of the operation
|
223
221
|
*
|
224
222
|
* @since 1.0.0
|
@@ -20,8 +20,10 @@
|
|
20
20
|
#include <couchbase/analytics_options.hxx>
|
21
21
|
#include <couchbase/collection.hxx>
|
22
22
|
#include <couchbase/query_options.hxx>
|
23
|
+
#include <couchbase/scope_search_index_manager.hxx>
|
23
24
|
#include <couchbase/search_options.hxx>
|
24
25
|
#include <couchbase/search_query.hxx>
|
26
|
+
#include <couchbase/search_request.hxx>
|
25
27
|
|
26
28
|
#include <memory>
|
27
29
|
|
@@ -112,10 +114,12 @@ class scope
|
|
112
114
|
-> std::future<std::pair<query_error_context, query_result>>;
|
113
115
|
|
114
116
|
/**
|
115
|
-
* Performs a
|
117
|
+
* Performs a request against the full text search services.
|
118
|
+
*
|
119
|
+
* This can be used to perform a traditional FTS query, and/or a vector search.
|
116
120
|
*
|
117
121
|
* @param index_name name of the search index
|
118
|
-
* @param
|
122
|
+
* @param request request object, see @ref search_request for more details.
|
119
123
|
* @param options options to customize the query request.
|
120
124
|
* @param handler the handler that implements @ref search_handler
|
121
125
|
*
|
@@ -125,15 +129,17 @@ class scope
|
|
125
129
|
* @see https://docs.couchbase.com/server/current/fts/fts-introduction.html
|
126
130
|
*
|
127
131
|
* @since 1.0.0
|
128
|
-
* @
|
132
|
+
* @volatile
|
129
133
|
*/
|
130
|
-
void
|
134
|
+
void search(std::string index_name, search_request request, const search_options& options, search_handler&& handler) const;
|
131
135
|
|
132
136
|
/**
|
133
|
-
* Performs a
|
137
|
+
* Performs a request against the full text search services.
|
138
|
+
*
|
139
|
+
* This can be used to perform a traditional FTS query, and/or a vector search.
|
134
140
|
*
|
135
141
|
* @param index_name name of the search index
|
136
|
-
* @param
|
142
|
+
* @param request request object, see @ref search_request for more details.
|
137
143
|
* @param options options to customize the query request.
|
138
144
|
* @return future object that carries result of the operation
|
139
145
|
*
|
@@ -143,9 +149,9 @@ class scope
|
|
143
149
|
* @see https://docs.couchbase.com/server/current/fts/fts-introduction.html
|
144
150
|
*
|
145
151
|
* @since 1.0.0
|
146
|
-
* @
|
152
|
+
* @volatile
|
147
153
|
*/
|
148
|
-
[[nodiscard]] auto
|
154
|
+
[[nodiscard]] auto search(std::string index_name, search_request request, const search_options& = {}) const
|
149
155
|
-> std::future<std::pair<search_error_context, search_result>>;
|
150
156
|
|
151
157
|
/**
|
@@ -180,6 +186,16 @@ class scope
|
|
180
186
|
[[nodiscard]] auto analytics_query(std::string statement, const analytics_options& options = {}) const
|
181
187
|
-> std::future<std::pair<analytics_error_context, analytics_result>>;
|
182
188
|
|
189
|
+
/**
|
190
|
+
* Provides access to search index management services at the scope level
|
191
|
+
*
|
192
|
+
* @return a manager instance
|
193
|
+
*
|
194
|
+
* @since 1.0.0
|
195
|
+
* @volatile
|
196
|
+
*/
|
197
|
+
[[nodiscard]] auto search_indexes() const -> scope_search_index_manager;
|
198
|
+
|
183
199
|
private:
|
184
200
|
friend class bucket;
|
185
201
|
|