couchbase 4.2.9 → 4.2.10
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 +52 -2
- package/deps/couchbase-cxx-client/core/bucket.hxx +1 -1
- package/deps/couchbase-cxx-client/core/cluster.cxx +38 -0
- 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/diagnostics.cxx +294 -0
- package/deps/couchbase-cxx-client/core/impl/diagnostics.hxx +39 -0
- 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/mcbp_session.cxx +24 -32
- package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +1 -0
- package/deps/couchbase-cxx-client/core/logger/logger.cxx +1 -1
- package/deps/couchbase-cxx-client/core/meta/features.hxx +10 -0
- package/deps/couchbase-cxx-client/core/operations/document_query.cxx +6 -1
- 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/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/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/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/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/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/get_options.hxx +1 -6
- 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/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 +9 -0
- package/dist/binding.js +4 -1
- package/dist/bindingutilities.d.ts +6 -1
- package/dist/bindingutilities.js +15 -1
- package/dist/cluster.d.ts +12 -1
- package/dist/cluster.js +22 -0
- package/dist/couchbase.d.ts +1 -0
- package/dist/couchbase.js +1 -0
- package/dist/searchexecutor.d.ts +2 -2
- package/dist/searchexecutor.js +19 -3
- 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/package.json +7 -7
- package/src/constants.cpp +11 -0
- package/src/jstocbpp_autogen.hpp +24 -7
- package/tools/gen-bindings-json.py +2 -0
@@ -89,6 +89,15 @@ class scope_impl
|
|
89
89
|
});
|
90
90
|
}
|
91
91
|
|
92
|
+
void search(std::string index_name, couchbase::search_request request, search_options::built options, search_handler&& handler) const
|
93
|
+
{
|
94
|
+
return core_.execute(core::impl::build_search_request(std::move(index_name), std::move(request), options, bucket_name_, name_),
|
95
|
+
[handler = std::move(handler)](auto&& resp) mutable {
|
96
|
+
return handler(search_error_context{ internal_search_error_context{ resp } },
|
97
|
+
search_result{ internal_search_result{ resp } });
|
98
|
+
});
|
99
|
+
}
|
100
|
+
|
92
101
|
private:
|
93
102
|
core::cluster core_;
|
94
103
|
std::string bucket_name_;
|
@@ -153,20 +162,26 @@ scope::analytics_query(std::string statement, const analytics_options& options)
|
|
153
162
|
}
|
154
163
|
|
155
164
|
void
|
156
|
-
scope::
|
165
|
+
scope::search(std::string index_name, search_request request, const search_options& options, search_handler&& handler) const
|
157
166
|
{
|
158
|
-
return impl_->
|
167
|
+
return impl_->search(std::move(index_name), std::move(request), options.build(), std::move(handler));
|
159
168
|
}
|
160
169
|
|
161
170
|
auto
|
162
|
-
scope::
|
171
|
+
scope::search(std::string index_name, search_request request, const search_options& options) const
|
163
172
|
-> std::future<std::pair<search_error_context, search_result>>
|
164
173
|
{
|
165
174
|
auto barrier = std::make_shared<std::promise<std::pair<search_error_context, search_result>>>();
|
166
175
|
auto future = barrier->get_future();
|
167
|
-
|
176
|
+
search(std::move(index_name), std::move(request), options, [barrier](auto ctx, auto result) {
|
168
177
|
barrier->set_value({ std::move(ctx), std::move(result) });
|
169
178
|
});
|
170
179
|
return future;
|
171
180
|
}
|
181
|
+
|
182
|
+
auto
|
183
|
+
scope::search_indexes() const -> scope_search_index_manager
|
184
|
+
{
|
185
|
+
return scope_search_index_manager{ impl_->core(), impl_->bucket_name(), impl_->name() };
|
186
|
+
}
|
172
187
|
} // namespace couchbase
|
@@ -26,6 +26,8 @@
|
|
26
26
|
#include "internal_term_facet_result.hxx"
|
27
27
|
|
28
28
|
#include <couchbase/cluster.hxx>
|
29
|
+
#include <couchbase/match_none_query.hxx>
|
30
|
+
#include <utility>
|
29
31
|
|
30
32
|
#include <fmt/core.h>
|
31
33
|
|
@@ -102,14 +104,29 @@ map_raw(std::map<std::string, codec::binary, std::less<>>& raw)
|
|
102
104
|
}
|
103
105
|
return core_raw;
|
104
106
|
}
|
107
|
+
|
108
|
+
static std::optional<core::vector_query_combination>
|
109
|
+
map_vector_query_combination(const std::optional<couchbase::vector_query_combination>& combination)
|
110
|
+
{
|
111
|
+
if (combination) {
|
112
|
+
switch (combination.value()) {
|
113
|
+
case couchbase::vector_query_combination::combination_and:
|
114
|
+
return core::vector_query_combination::combination_and;
|
115
|
+
case couchbase::vector_query_combination::combination_or:
|
116
|
+
return core::vector_query_combination::combination_or;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
return {};
|
120
|
+
}
|
121
|
+
|
105
122
|
} // namespace
|
106
123
|
|
107
124
|
core::operations::search_request
|
108
125
|
build_search_request(std::string index_name,
|
109
126
|
const search_query& query,
|
110
127
|
search_options::built options,
|
111
|
-
std::optional<std::string>
|
112
|
-
std::optional<std::string>
|
128
|
+
std::optional<std::string> bucket_name,
|
129
|
+
std::optional<std::string> scope_name)
|
113
130
|
{
|
114
131
|
auto encoded = query.encode();
|
115
132
|
if (encoded.ec) {
|
@@ -118,6 +135,11 @@ build_search_request(std::string index_name,
|
|
118
135
|
core::operations::search_request request{
|
119
136
|
std::move(index_name),
|
120
137
|
core::utils::json::generate_binary(encoded.query),
|
138
|
+
std::move(bucket_name),
|
139
|
+
std::move(scope_name),
|
140
|
+
{},
|
141
|
+
{},
|
142
|
+
{},
|
121
143
|
options.limit,
|
122
144
|
options.skip,
|
123
145
|
options.explain,
|
@@ -139,4 +161,55 @@ build_search_request(std::string index_name,
|
|
139
161
|
return request;
|
140
162
|
}
|
141
163
|
|
164
|
+
core::operations::search_request
|
165
|
+
build_search_request(std::string index_name,
|
166
|
+
couchbase::search_request request,
|
167
|
+
search_options::built options,
|
168
|
+
std::optional<std::string> bucket_name,
|
169
|
+
std::optional<std::string> scope_name)
|
170
|
+
{
|
171
|
+
if (!request.search_query().has_value()) {
|
172
|
+
request.search_query(couchbase::match_none_query{});
|
173
|
+
}
|
174
|
+
|
175
|
+
core::operations::search_request core_request{
|
176
|
+
std::move(index_name),
|
177
|
+
core::utils::json::generate_binary(request.search_query().value().query),
|
178
|
+
std::move(bucket_name),
|
179
|
+
std::move(scope_name),
|
180
|
+
false,
|
181
|
+
{},
|
182
|
+
{},
|
183
|
+
options.limit,
|
184
|
+
options.skip,
|
185
|
+
options.explain,
|
186
|
+
options.disable_scoring,
|
187
|
+
options.include_locations,
|
188
|
+
map_highlight_style(options.highlight_style),
|
189
|
+
options.highlight_fields,
|
190
|
+
options.fields,
|
191
|
+
options.collections,
|
192
|
+
map_scan_consistency(options.scan_consistency),
|
193
|
+
options.mutation_state,
|
194
|
+
map_sort(options.sort, options.sort_string),
|
195
|
+
map_facets(options.facets),
|
196
|
+
map_raw(options.raw),
|
197
|
+
{},
|
198
|
+
options.client_context_id,
|
199
|
+
options.timeout,
|
200
|
+
};
|
201
|
+
|
202
|
+
if (!request.vector_search().has_value()) {
|
203
|
+
return core_request;
|
204
|
+
}
|
205
|
+
core_request.vector_search = core::utils::json::generate_binary(request.vector_search().value().query);
|
206
|
+
|
207
|
+
auto vector_search_options = request.vector_options();
|
208
|
+
if (!vector_search_options.has_value()) {
|
209
|
+
return core_request;
|
210
|
+
}
|
211
|
+
|
212
|
+
core_request.vector_query_combination = map_vector_query_combination(vector_search_options.value().combination);
|
213
|
+
return core_request;
|
214
|
+
}
|
142
215
|
} // namespace couchbase::core::impl
|
@@ -21,6 +21,7 @@
|
|
21
21
|
|
22
22
|
#include <couchbase/search_options.hxx>
|
23
23
|
#include <couchbase/search_query.hxx>
|
24
|
+
#include <couchbase/search_request.hxx>
|
24
25
|
|
25
26
|
#include <optional>
|
26
27
|
#include <string>
|
@@ -34,4 +35,11 @@ build_search_request(std::string index_name,
|
|
34
35
|
std::optional<std::string> bucket_name,
|
35
36
|
std::optional<std::string> scope_name);
|
36
37
|
|
38
|
+
core::operations::search_request
|
39
|
+
build_search_request(std::string index_name,
|
40
|
+
search_request request,
|
41
|
+
search_options::built options,
|
42
|
+
std::optional<std::string> bucket_name,
|
43
|
+
std::optional<std::string> scope_name);
|
44
|
+
|
37
45
|
} // namespace couchbase::core::impl
|
@@ -29,6 +29,7 @@
|
|
29
29
|
#include "core/utils/json.hxx"
|
30
30
|
#include "internal_manager_error_context.hxx"
|
31
31
|
|
32
|
+
#include <couchbase/scope_search_index_manager.hxx>
|
32
33
|
#include <couchbase/search_index_manager.hxx>
|
33
34
|
|
34
35
|
#include <memory>
|
@@ -145,19 +146,26 @@ class search_index_manager_impl
|
|
145
146
|
{
|
146
147
|
}
|
147
148
|
|
149
|
+
explicit search_index_manager_impl(core::cluster core, std::string bucket_name, std::string scope_name)
|
150
|
+
: core_{ std::move(core) }
|
151
|
+
, bucket_name_{ std::move(bucket_name) }
|
152
|
+
, scope_name_{ std::move(scope_name) }
|
153
|
+
{
|
154
|
+
}
|
155
|
+
|
148
156
|
void get_index(std::string index_name,
|
149
157
|
const couchbase::get_search_index_options::built& options,
|
150
158
|
get_search_index_handler&& handler) const
|
151
159
|
{
|
152
160
|
core_.execute(
|
153
|
-
core::operations::management::search_index_get_request{ std::move(index_name), {}, options.timeout },
|
161
|
+
core::operations::management::search_index_get_request{ std::move(index_name), bucket_name_, scope_name_, {}, options.timeout },
|
154
162
|
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp), map_search_index(resp.index)); });
|
155
163
|
}
|
156
164
|
|
157
165
|
void get_all_indexes(const get_all_search_indexes_options::built& options, get_all_search_indexes_handler&& handler) const
|
158
166
|
{
|
159
167
|
core_.execute(
|
160
|
-
core::operations::management::search_index_get_all_request{ {}, options.timeout },
|
168
|
+
core::operations::management::search_index_get_all_request{ bucket_name_, scope_name_, {}, options.timeout },
|
161
169
|
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp), map_all_search_indexes(resp.indexes)); });
|
162
170
|
}
|
163
171
|
|
@@ -165,30 +173,37 @@ class search_index_manager_impl
|
|
165
173
|
const upsert_search_index_options::built& options,
|
166
174
|
upsert_search_index_handler&& handler) const
|
167
175
|
{
|
168
|
-
core_.execute(
|
169
|
-
|
176
|
+
core_.execute(
|
177
|
+
core::operations::management::search_index_upsert_request{
|
178
|
+
map_search_index(search_index), bucket_name_, scope_name_, {}, options.timeout },
|
179
|
+
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
170
180
|
}
|
171
181
|
|
172
182
|
void drop_index(std::string index_name, const drop_search_index_options::built& options, drop_search_index_handler&& handler) const
|
173
183
|
{
|
174
|
-
core_.execute(
|
175
|
-
|
184
|
+
core_.execute(
|
185
|
+
core::operations::management::search_index_drop_request{ std::move(index_name), bucket_name_, scope_name_, {}, options.timeout },
|
186
|
+
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
176
187
|
}
|
177
188
|
|
178
189
|
void get_indexed_documents_count(std::string index_name,
|
179
190
|
const get_indexed_search_index_options::built& options,
|
180
191
|
get_indexed_search_index_handler&& handler) const
|
181
192
|
{
|
182
|
-
core_.execute(
|
183
|
-
|
193
|
+
core_.execute(
|
194
|
+
core::operations::management::search_index_get_documents_count_request{
|
195
|
+
std::move(index_name), bucket_name_, scope_name_, {}, options.timeout },
|
196
|
+
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp), resp.count); });
|
184
197
|
}
|
185
198
|
|
186
199
|
void pause_ingest(std::string index_name,
|
187
200
|
const pause_ingest_search_index_options::built& options,
|
188
201
|
pause_ingest_search_index_handler&& handler) const
|
189
202
|
{
|
190
|
-
core_.execute(
|
191
|
-
|
203
|
+
core_.execute(
|
204
|
+
core::operations::management::search_index_control_ingest_request{
|
205
|
+
std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout },
|
206
|
+
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
192
207
|
}
|
193
208
|
|
194
209
|
void resume_ingest(std::string index_name,
|
@@ -196,7 +211,8 @@ class search_index_manager_impl
|
|
196
211
|
resume_ingest_search_index_handler&& handler) const
|
197
212
|
{
|
198
213
|
core_.execute(
|
199
|
-
core::operations::management::search_index_control_ingest_request{
|
214
|
+
core::operations::management::search_index_control_ingest_request{
|
215
|
+
std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout },
|
200
216
|
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
201
217
|
}
|
202
218
|
|
@@ -204,16 +220,20 @@ class search_index_manager_impl
|
|
204
220
|
const allow_querying_search_index_options::built& options,
|
205
221
|
allow_querying_search_index_handler&& handler) const
|
206
222
|
{
|
207
|
-
core_.execute(
|
208
|
-
|
223
|
+
core_.execute(
|
224
|
+
core::operations::management::search_index_control_query_request{
|
225
|
+
std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout },
|
226
|
+
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
209
227
|
}
|
210
228
|
|
211
229
|
void disallow_querying(std::string index_name,
|
212
230
|
const disallow_querying_search_index_options::built& options,
|
213
231
|
disallow_querying_search_index_handler&& handler) const
|
214
232
|
{
|
215
|
-
core_.execute(
|
216
|
-
|
233
|
+
core_.execute(
|
234
|
+
core::operations::management::search_index_control_query_request{
|
235
|
+
std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout },
|
236
|
+
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
217
237
|
}
|
218
238
|
|
219
239
|
void freeze_plan(std::string index_name,
|
@@ -221,7 +241,8 @@ class search_index_manager_impl
|
|
221
241
|
freeze_plan_search_index_handler&& handler) const
|
222
242
|
{
|
223
243
|
core_.execute(
|
224
|
-
core::operations::management::search_index_control_plan_freeze_request{
|
244
|
+
core::operations::management::search_index_control_plan_freeze_request{
|
245
|
+
std::move(index_name), true, bucket_name_, scope_name_, {}, options.timeout },
|
225
246
|
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
226
247
|
}
|
227
248
|
|
@@ -230,7 +251,8 @@ class search_index_manager_impl
|
|
230
251
|
unfreeze_plan_search_index_handler&& handler) const
|
231
252
|
{
|
232
253
|
core_.execute(
|
233
|
-
core::operations::management::search_index_control_plan_freeze_request{
|
254
|
+
core::operations::management::search_index_control_plan_freeze_request{
|
255
|
+
std::move(index_name), false, bucket_name_, scope_name_, {}, options.timeout },
|
234
256
|
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp)); });
|
235
257
|
}
|
236
258
|
|
@@ -241,12 +263,14 @@ class search_index_manager_impl
|
|
241
263
|
{
|
242
264
|
core_.execute(
|
243
265
|
core::operations::management::search_index_analyze_document_request{
|
244
|
-
std::move(index_name), std::move(document), {}, options.timeout },
|
266
|
+
std::move(index_name), std::move(document), bucket_name_, scope_name_, {}, options.timeout },
|
245
267
|
[handler = std::move(handler)](auto resp) mutable { return handler(build_context(resp), convert_analysis(resp.analysis)); });
|
246
268
|
}
|
247
269
|
|
248
270
|
private:
|
249
271
|
core::cluster core_;
|
272
|
+
std::optional<std::string> bucket_name_{};
|
273
|
+
std::optional<std::string> scope_name_{};
|
250
274
|
};
|
251
275
|
|
252
276
|
search_index_manager::search_index_manager(core::cluster core)
|
@@ -466,4 +490,223 @@ search_index_manager::analyze_document(std::string index_name,
|
|
466
490
|
});
|
467
491
|
return barrier->get_future();
|
468
492
|
}
|
493
|
+
|
494
|
+
scope_search_index_manager::scope_search_index_manager(core::cluster core, std::string bucket_name, std::string scope_name)
|
495
|
+
: impl_(std::make_shared<search_index_manager_impl>(std::move(core), std::move(bucket_name), std::move(scope_name)))
|
496
|
+
{
|
497
|
+
}
|
498
|
+
|
499
|
+
void
|
500
|
+
scope_search_index_manager::get_index(std::string index_name,
|
501
|
+
const couchbase::get_search_index_options& options,
|
502
|
+
couchbase::get_search_index_handler&& handler) const
|
503
|
+
{
|
504
|
+
return impl_->get_index(std::move(index_name), options.build(), std::move(handler));
|
505
|
+
}
|
506
|
+
|
507
|
+
auto
|
508
|
+
scope_search_index_manager::get_index(std::string index_name, const couchbase::get_search_index_options& options) const
|
509
|
+
-> std::future<std::pair<manager_error_context, management::search::index>>
|
510
|
+
{
|
511
|
+
auto barrier = std::make_shared<std::promise<std::pair<manager_error_context, management::search::index>>>();
|
512
|
+
get_index(std::move(index_name), options, [barrier](auto ctx, auto result) mutable {
|
513
|
+
barrier->set_value(std::make_pair(std::move(ctx), std::move(result)));
|
514
|
+
});
|
515
|
+
return barrier->get_future();
|
516
|
+
}
|
517
|
+
|
518
|
+
void
|
519
|
+
scope_search_index_manager::get_all_indexes(const couchbase::get_all_search_indexes_options& options,
|
520
|
+
get_all_search_indexes_handler&& handler) const
|
521
|
+
{
|
522
|
+
return impl_->get_all_indexes(options.build(), std::move(handler));
|
523
|
+
}
|
524
|
+
|
525
|
+
auto
|
526
|
+
scope_search_index_manager::get_all_indexes(const couchbase::get_all_search_indexes_options& options) const
|
527
|
+
-> std::future<std::pair<manager_error_context, std::vector<management::search::index>>>
|
528
|
+
{
|
529
|
+
auto barrier = std::make_shared<std::promise<std::pair<manager_error_context, std::vector<management::search::index>>>>();
|
530
|
+
get_all_indexes(options,
|
531
|
+
[barrier](auto ctx, auto result) mutable { barrier->set_value(std::make_pair(std::move(ctx), std::move(result))); });
|
532
|
+
return barrier->get_future();
|
533
|
+
}
|
534
|
+
|
535
|
+
void
|
536
|
+
scope_search_index_manager::upsert_index(const management::search::index& search_index,
|
537
|
+
const couchbase::upsert_search_index_options& options,
|
538
|
+
couchbase::upsert_search_index_handler&& handler) const
|
539
|
+
{
|
540
|
+
return impl_->upsert_index(search_index, options.build(), std::move(handler));
|
541
|
+
}
|
542
|
+
|
543
|
+
auto
|
544
|
+
scope_search_index_manager::upsert_index(const management::search::index& search_index,
|
545
|
+
const couchbase::upsert_search_index_options& options) const -> std::future<manager_error_context>
|
546
|
+
{
|
547
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
548
|
+
upsert_index(search_index, options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
549
|
+
return barrier->get_future();
|
550
|
+
}
|
551
|
+
|
552
|
+
void
|
553
|
+
scope_search_index_manager::drop_index(std::string index_name,
|
554
|
+
const couchbase::drop_search_index_options& options,
|
555
|
+
couchbase::drop_search_index_handler&& handler) const
|
556
|
+
{
|
557
|
+
return impl_->drop_index(std::move(index_name), options.build(), std::move(handler));
|
558
|
+
}
|
559
|
+
|
560
|
+
auto
|
561
|
+
scope_search_index_manager::drop_index(std::string index_name, const couchbase::drop_search_index_options& options) const
|
562
|
+
-> std::future<manager_error_context>
|
563
|
+
{
|
564
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
565
|
+
drop_index(std::move(index_name), options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
566
|
+
return barrier->get_future();
|
567
|
+
}
|
568
|
+
|
569
|
+
void
|
570
|
+
scope_search_index_manager::get_indexed_documents_count(std::string index_name,
|
571
|
+
const couchbase::get_indexed_search_index_options& options,
|
572
|
+
couchbase::get_indexed_search_index_handler&& handler) const
|
573
|
+
{
|
574
|
+
return impl_->get_indexed_documents_count(std::move(index_name), options.build(), std::move(handler));
|
575
|
+
}
|
576
|
+
|
577
|
+
auto
|
578
|
+
scope_search_index_manager::get_indexed_documents_count(std::string index_name, const get_indexed_search_index_options& options) const
|
579
|
+
-> std::future<std::pair<manager_error_context, std::uint64_t>>
|
580
|
+
{
|
581
|
+
auto barrier = std::make_shared<std::promise<std::pair<manager_error_context, std::uint64_t>>>();
|
582
|
+
get_indexed_documents_count(std::move(index_name), options, [barrier](auto ctx, auto result) mutable {
|
583
|
+
barrier->set_value(std::make_pair(std::move(ctx), std::move(result)));
|
584
|
+
});
|
585
|
+
return barrier->get_future();
|
586
|
+
}
|
587
|
+
|
588
|
+
void
|
589
|
+
scope_search_index_manager::pause_ingest(std::string index_name,
|
590
|
+
const couchbase::pause_ingest_search_index_options& options,
|
591
|
+
couchbase::pause_ingest_search_index_handler&& handler) const
|
592
|
+
{
|
593
|
+
return impl_->pause_ingest(std::move(index_name), options.build(), std::move(handler));
|
594
|
+
}
|
595
|
+
|
596
|
+
auto
|
597
|
+
scope_search_index_manager::pause_ingest(std::string index_name, const couchbase::pause_ingest_search_index_options& options) const
|
598
|
+
-> std::future<manager_error_context>
|
599
|
+
{
|
600
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
601
|
+
pause_ingest(std::move(index_name), options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
602
|
+
return barrier->get_future();
|
603
|
+
}
|
604
|
+
|
605
|
+
void
|
606
|
+
scope_search_index_manager::resume_ingest(std::string index_name,
|
607
|
+
const couchbase::resume_ingest_search_index_options& options,
|
608
|
+
couchbase::resume_ingest_search_index_handler&& handler) const
|
609
|
+
{
|
610
|
+
return impl_->resume_ingest(std::move(index_name), options.build(), std::move(handler));
|
611
|
+
}
|
612
|
+
|
613
|
+
auto
|
614
|
+
scope_search_index_manager::resume_ingest(std::string index_name, const couchbase::resume_ingest_search_index_options& options) const
|
615
|
+
-> std::future<manager_error_context>
|
616
|
+
{
|
617
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
618
|
+
resume_ingest(std::move(index_name), options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
619
|
+
return barrier->get_future();
|
620
|
+
}
|
621
|
+
|
622
|
+
void
|
623
|
+
scope_search_index_manager::allow_querying(std::string index_name,
|
624
|
+
const couchbase::allow_querying_search_index_options& options,
|
625
|
+
couchbase::allow_querying_search_index_handler&& handler) const
|
626
|
+
{
|
627
|
+
return impl_->allow_querying(std::move(index_name), options.build(), std::move(handler));
|
628
|
+
}
|
629
|
+
|
630
|
+
auto
|
631
|
+
scope_search_index_manager::allow_querying(std::string index_name, const couchbase::allow_querying_search_index_options& options) const
|
632
|
+
-> std::future<manager_error_context>
|
633
|
+
{
|
634
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
635
|
+
allow_querying(std::move(index_name), options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
636
|
+
return barrier->get_future();
|
637
|
+
}
|
638
|
+
|
639
|
+
void
|
640
|
+
scope_search_index_manager::disallow_querying(std::string index_name,
|
641
|
+
const couchbase::disallow_querying_search_index_options& options,
|
642
|
+
couchbase::disallow_querying_search_index_handler&& handler) const
|
643
|
+
{
|
644
|
+
return impl_->disallow_querying(std::move(index_name), options.build(), std::move(handler));
|
645
|
+
}
|
646
|
+
|
647
|
+
auto
|
648
|
+
scope_search_index_manager::disallow_querying(std::string index_name,
|
649
|
+
const couchbase::disallow_querying_search_index_options& options) const
|
650
|
+
-> std::future<manager_error_context>
|
651
|
+
{
|
652
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
653
|
+
disallow_querying(std::move(index_name), options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
654
|
+
return barrier->get_future();
|
655
|
+
}
|
656
|
+
|
657
|
+
void
|
658
|
+
scope_search_index_manager::freeze_plan(std::string index_name,
|
659
|
+
const couchbase::freeze_plan_search_index_options& options,
|
660
|
+
couchbase::freeze_plan_search_index_handler&& handler) const
|
661
|
+
{
|
662
|
+
return impl_->freeze_plan(std::move(index_name), options.build(), std::move(handler));
|
663
|
+
}
|
664
|
+
|
665
|
+
auto
|
666
|
+
scope_search_index_manager::freeze_plan(std::string index_name, const couchbase::freeze_plan_search_index_options& options) const
|
667
|
+
-> std::future<manager_error_context>
|
668
|
+
{
|
669
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
670
|
+
freeze_plan(std::move(index_name), options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
671
|
+
return barrier->get_future();
|
672
|
+
}
|
673
|
+
|
674
|
+
void
|
675
|
+
scope_search_index_manager::unfreeze_plan(std::string index_name,
|
676
|
+
const couchbase::unfreeze_plan_search_index_options& options,
|
677
|
+
couchbase::unfreeze_plan_search_index_handler&& handler) const
|
678
|
+
{
|
679
|
+
return impl_->unfreeze_plan(std::move(index_name), options.build(), std::move(handler));
|
680
|
+
}
|
681
|
+
|
682
|
+
auto
|
683
|
+
scope_search_index_manager::unfreeze_plan(std::string index_name, const couchbase::unfreeze_plan_search_index_options& options) const
|
684
|
+
-> std::future<manager_error_context>
|
685
|
+
{
|
686
|
+
auto barrier = std::make_shared<std::promise<manager_error_context>>();
|
687
|
+
unfreeze_plan(std::move(index_name), options, [barrier](auto ctx) mutable { barrier->set_value(std::move(ctx)); });
|
688
|
+
return barrier->get_future();
|
689
|
+
}
|
690
|
+
|
691
|
+
void
|
692
|
+
scope_search_index_manager::analyze_document(std::string index_name,
|
693
|
+
std::string document,
|
694
|
+
const couchbase::analyze_document_options& options,
|
695
|
+
couchbase::analyze_document_handler&& handler) const
|
696
|
+
{
|
697
|
+
return impl_->analyze_document(std::move(index_name), std::move(document), options.build(), std::move(handler));
|
698
|
+
}
|
699
|
+
|
700
|
+
auto
|
701
|
+
scope_search_index_manager::analyze_document(std::string index_name,
|
702
|
+
std::string document,
|
703
|
+
const couchbase::analyze_document_options& options) const
|
704
|
+
-> std::future<std::pair<manager_error_context, std::vector<std::string>>>
|
705
|
+
{
|
706
|
+
auto barrier = std::make_shared<std::promise<std::pair<manager_error_context, std::vector<std::string>>>>();
|
707
|
+
analyze_document(std::move(index_name), std::move(document), options, [barrier](auto ctx, auto result) mutable {
|
708
|
+
barrier->set_value(std::make_pair(std::move(ctx), std::move(result)));
|
709
|
+
});
|
710
|
+
return barrier->get_future();
|
711
|
+
}
|
469
712
|
} // namespace couchbase
|