couchbase 4.2.3 → 4.2.5-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CMakeLists.txt +136 -11
- package/deps/couchbase-cxx-client/CMakeLists.txt +54 -4
- package/deps/couchbase-cxx-client/README.md +1 -0
- package/deps/couchbase-cxx-client/bin/create-search-index +164 -0
- package/deps/couchbase-cxx-client/bin/init-cluster +55 -10
- package/deps/couchbase-cxx-client/bin/run-unit-tests +62 -6
- package/deps/couchbase-cxx-client/bin/travel-sample-index-v6.json +184 -0
- package/deps/couchbase-cxx-client/bin/travel-sample-index.json +188 -0
- package/deps/couchbase-cxx-client/cmake/Documentation.cmake +0 -1
- package/deps/couchbase-cxx-client/cmake/OpenSSL.cmake +98 -3
- package/deps/couchbase-cxx-client/cmake/Testing.cmake +8 -0
- package/deps/couchbase-cxx-client/cmake/build_config.hxx.in +3 -0
- package/deps/couchbase-cxx-client/core/bucket.cxx +183 -152
- package/deps/couchbase-cxx-client/core/bucket.hxx +17 -4
- package/deps/couchbase-cxx-client/core/cluster.hxx +18 -1
- package/deps/couchbase-cxx-client/core/cluster_options.hxx +1 -0
- package/deps/couchbase-cxx-client/core/error_context/key_value.cxx +2 -1
- package/deps/couchbase-cxx-client/core/error_context/key_value.hxx +10 -12
- package/deps/couchbase-cxx-client/core/error_context/search.hxx +1 -1
- package/deps/couchbase-cxx-client/core/impl/analytics.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/boolean_field_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/boolean_query.cxx +62 -0
- package/deps/couchbase-cxx-client/core/impl/cluster.cxx +1 -0
- package/deps/couchbase-cxx-client/core/impl/conjunction_query.cxx +51 -0
- package/deps/couchbase-cxx-client/core/impl/date_range.cxx +89 -0
- package/deps/couchbase-cxx-client/core/impl/date_range_facet.cxx +54 -0
- package/deps/couchbase-cxx-client/core/impl/date_range_facet_result.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/date_range_query.cxx +125 -0
- package/deps/couchbase-cxx-client/core/impl/disjunction_query.cxx +51 -0
- package/deps/couchbase-cxx-client/core/impl/encoded_search_facet.hxx +29 -0
- package/deps/couchbase-cxx-client/core/impl/encoded_search_query.hxx +29 -0
- package/deps/couchbase-cxx-client/core/impl/encoded_search_sort.hxx +29 -0
- package/deps/couchbase-cxx-client/core/impl/geo_bounding_box_query.cxx +46 -0
- package/deps/couchbase-cxx-client/core/impl/geo_distance_query.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/geo_polygon_query.cxx +46 -0
- package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.cxx +80 -0
- package/deps/couchbase-cxx-client/core/impl/internal_date_range_facet_result.hxx +48 -0
- package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.cxx +80 -0
- package/deps/couchbase-cxx-client/core/impl/internal_numeric_range_facet_result.hxx +48 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.cxx +141 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_error_context.hxx +61 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.cxx +60 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_meta_data.hxx +41 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_result.cxx +84 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_result.hxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row.cxx +82 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row.hxx +56 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row_location.hxx +32 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.cxx +137 -0
- package/deps/couchbase-cxx-client/core/impl/internal_search_row_locations.hxx +45 -0
- package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.cxx +80 -0
- package/deps/couchbase-cxx-client/core/impl/internal_term_facet_result.hxx +48 -0
- package/deps/couchbase-cxx-client/core/impl/key_value_error_context.cxx +98 -0
- package/deps/couchbase-cxx-client/core/impl/match_all_query.cxx +35 -0
- package/deps/couchbase-cxx-client/core/impl/match_none_query.cxx +35 -0
- package/deps/couchbase-cxx-client/core/impl/match_phrase_query.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/match_query.cxx +59 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range.cxx +49 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range_facet.cxx +54 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range_facet_result.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/numeric_range_query.cxx +56 -0
- package/deps/couchbase-cxx-client/core/impl/phrase_query.cxx +42 -0
- package/deps/couchbase-cxx-client/core/impl/prefix_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/query_error_context.cxx +75 -0
- package/deps/couchbase-cxx-client/core/impl/query_string_query.cxx +37 -0
- package/deps/couchbase-cxx-client/core/impl/regexp_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/impl/search.cxx +191 -0
- package/deps/couchbase-cxx-client/core/impl/search_error_context.cxx +147 -0
- package/deps/couchbase-cxx-client/core/impl/search_meta_data.cxx +46 -0
- package/deps/couchbase-cxx-client/core/impl/search_result.cxx +66 -0
- package/deps/couchbase-cxx-client/core/impl/search_row.cxx +74 -0
- package/deps/couchbase-cxx-client/core/impl/search_row_location.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/search_row_locations.cxx +66 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_field.cxx +104 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_id.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/search_sort_score.cxx +43 -0
- package/deps/couchbase-cxx-client/core/impl/term_facet.cxx +36 -0
- package/deps/couchbase-cxx-client/core/impl/term_facet_result.cxx +64 -0
- package/deps/couchbase-cxx-client/core/impl/term_query.cxx +56 -0
- package/deps/couchbase-cxx-client/core/impl/term_range_query.cxx +57 -0
- package/deps/couchbase-cxx-client/core/impl/wildcard_query.cxx +40 -0
- package/deps/couchbase-cxx-client/core/io/mcbp_command.hxx +9 -2
- package/deps/couchbase-cxx-client/core/io/mcbp_session.cxx +54 -37
- package/deps/couchbase-cxx-client/core/io/mcbp_session.hxx +4 -3
- package/deps/couchbase-cxx-client/core/json_string.hxx +5 -0
- package/deps/couchbase-cxx-client/core/meta/version.cxx +18 -4
- package/deps/couchbase-cxx-client/core/mozilla_ca_bundle.hxx +39 -0
- package/deps/couchbase-cxx-client/core/operations/document_search.cxx +3 -1
- package/deps/couchbase-cxx-client/core/operations/document_search.hxx +1 -1
- package/deps/couchbase-cxx-client/core/protocol/client_request.hxx +11 -2
- package/deps/couchbase-cxx-client/core/protocol/client_response.hxx +1 -0
- package/deps/couchbase-cxx-client/core/utils/connection_string.cxx +59 -46
- package/deps/couchbase-cxx-client/core/utils/connection_string.hxx +1 -0
- package/deps/couchbase-cxx-client/couchbase/analytics_error_context.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/boolean_field_query.hxx +77 -0
- package/deps/couchbase-cxx-client/couchbase/boolean_query.hxx +223 -0
- package/deps/couchbase-cxx-client/couchbase/cluster.hxx +39 -0
- package/deps/couchbase-cxx-client/couchbase/conjunction_query.hxx +88 -0
- package/deps/couchbase-cxx-client/couchbase/date_range.hxx +69 -0
- package/deps/couchbase-cxx-client/couchbase/date_range_facet.hxx +56 -0
- package/deps/couchbase-cxx-client/couchbase/date_range_facet_result.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/date_range_query.hxx +265 -0
- package/deps/couchbase-cxx-client/couchbase/disjunction_query.hxx +109 -0
- package/deps/couchbase-cxx-client/couchbase/doc_id_query.hxx +111 -0
- package/deps/couchbase-cxx-client/couchbase/error_context.hxx +17 -8
- package/deps/couchbase-cxx-client/couchbase/fmt/analytics_scan_consistency.hxx +52 -0
- package/deps/couchbase-cxx-client/{core/topology/error_map_fmt.hxx → couchbase/fmt/key_value_error_map_attribute.hxx} +21 -21
- package/deps/couchbase-cxx-client/couchbase/fmt/search_scan_consistency.hxx +49 -0
- package/deps/couchbase-cxx-client/couchbase/geo_bounding_box_query.hxx +107 -0
- package/deps/couchbase-cxx-client/couchbase/geo_distance_query.hxx +109 -0
- package/deps/couchbase-cxx-client/couchbase/geo_point.hxx +32 -0
- package/deps/couchbase-cxx-client/couchbase/geo_polygon_query.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/highlight_style.hxx +45 -0
- package/deps/couchbase-cxx-client/couchbase/key_value_error_context.hxx +7 -2
- package/deps/couchbase-cxx-client/couchbase/manager_error_context.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/match_all_query.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/match_none_query.hxx +43 -0
- package/deps/couchbase-cxx-client/couchbase/match_operator.hxx +45 -0
- package/deps/couchbase-cxx-client/couchbase/match_phrase_query.hxx +108 -0
- package/deps/couchbase-cxx-client/couchbase/match_query.hxx +163 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range.hxx +58 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range_facet.hxx +56 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range_facet_result.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/numeric_range_query.hxx +143 -0
- package/deps/couchbase-cxx-client/couchbase/phrase_query.hxx +93 -0
- package/deps/couchbase-cxx-client/couchbase/prefix_query.hxx +82 -0
- package/deps/couchbase-cxx-client/couchbase/query_error_context.hxx +3 -1
- package/deps/couchbase-cxx-client/couchbase/query_string_query.hxx +72 -0
- package/deps/couchbase-cxx-client/couchbase/regexp_query.hxx +82 -0
- package/deps/couchbase-cxx-client/couchbase/scope.hxx +39 -0
- package/deps/couchbase-cxx-client/couchbase/search_date_range.hxx +68 -0
- package/deps/couchbase-cxx-client/couchbase/search_error_context.hxx +138 -0
- package/deps/couchbase-cxx-client/couchbase/search_facet.hxx +60 -0
- package/deps/couchbase-cxx-client/couchbase/search_facet_result.hxx +50 -0
- package/deps/couchbase-cxx-client/couchbase/search_meta_data.hxx +85 -0
- package/deps/couchbase-cxx-client/couchbase/search_metrics.hxx +127 -0
- package/deps/couchbase-cxx-client/couchbase/search_numeric_range.hxx +69 -0
- package/deps/couchbase-cxx-client/couchbase/search_options.hxx +509 -0
- package/deps/couchbase-cxx-client/couchbase/search_query.hxx +69 -0
- package/deps/couchbase-cxx-client/couchbase/search_result.hxx +77 -0
- package/deps/couchbase-cxx-client/couchbase/search_row.hxx +104 -0
- package/deps/couchbase-cxx-client/couchbase/search_row_location.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/search_row_locations.hxx +86 -0
- package/deps/couchbase-cxx-client/couchbase/search_scan_consistency.hxx +34 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort.hxx +58 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field.hxx +117 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field_missing.hxx +26 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field_mode.hxx +27 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_field_type.hxx +28 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_id.hxx +60 -0
- package/deps/couchbase-cxx-client/couchbase/search_sort_score.hxx +60 -0
- package/deps/couchbase-cxx-client/couchbase/search_term_range.hxx +51 -0
- package/deps/couchbase-cxx-client/couchbase/security_options.hxx +3 -0
- package/deps/couchbase-cxx-client/couchbase/subdocument_error_context.hxx +4 -2
- package/deps/couchbase-cxx-client/couchbase/term_facet.hxx +48 -0
- package/deps/couchbase-cxx-client/couchbase/term_facet_result.hxx +55 -0
- package/deps/couchbase-cxx-client/couchbase/term_query.hxx +151 -0
- package/deps/couchbase-cxx-client/couchbase/term_range_query.hxx +142 -0
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_options.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_query_options.hxx +2 -1
- package/deps/couchbase-cxx-client/couchbase/transactions/transaction_result.hxx +1 -1
- package/deps/couchbase-cxx-client/couchbase/transactions.hxx +3 -3
- package/deps/couchbase-cxx-client/couchbase/wildcard_query.hxx +83 -0
- package/deps/couchbase-cxx-client/docs/Doxyfile.in +1 -1
- package/deps/couchbase-cxx-client/docs/cbc-analytics.md +2 -2
- package/deps/couchbase-cxx-client/docs/cbc-get.md +3 -2
- package/deps/couchbase-cxx-client/docs/cbc-pillowfight.md +7 -2
- package/deps/couchbase-cxx-client/docs/cbc-query.md +2 -2
- package/deps/couchbase-cxx-client/docs/cbc.md +3 -3
- package/deps/couchbase-cxx-client/docs/cli.hxx +5 -5
- package/deps/couchbase-cxx-client/docs/mainpage.hxx +42 -5
- package/deps/couchbase-cxx-client/test/CMakeLists.txt +1 -0
- package/deps/couchbase-cxx-client/test/test_integration_analytics.cxx +28 -6
- package/deps/couchbase-cxx-client/test/test_integration_collections.cxx +7 -3
- package/deps/couchbase-cxx-client/test/test_integration_connect.cxx +7 -3
- package/deps/couchbase-cxx-client/test/test_integration_crud.cxx +13 -3
- package/deps/couchbase-cxx-client/test/test_integration_diagnostics.cxx +8 -2
- package/deps/couchbase-cxx-client/test/test_integration_durability.cxx +12 -7
- package/deps/couchbase-cxx-client/test/test_integration_examples.cxx +283 -11
- package/deps/couchbase-cxx-client/test/test_integration_management.cxx +140 -88
- package/deps/couchbase-cxx-client/test/test_integration_query.cxx +67 -9
- package/deps/couchbase-cxx-client/test/test_integration_range_scan.cxx +12 -12
- package/deps/couchbase-cxx-client/test/test_integration_read_replica.cxx +48 -11
- package/deps/couchbase-cxx-client/test/test_integration_search.cxx +19 -1
- package/deps/couchbase-cxx-client/test/test_integration_subdoc.cxx +60 -9
- package/deps/couchbase-cxx-client/test/test_integration_tracer.cxx +3 -0
- package/deps/couchbase-cxx-client/test/test_integration_transcoders.cxx +4 -0
- package/deps/couchbase-cxx-client/test/test_transaction_examples.cxx +100 -85
- package/deps/couchbase-cxx-client/test/test_unit_connection_string.cxx +29 -0
- package/deps/couchbase-cxx-client/test/test_unit_search.cxx +427 -0
- package/deps/couchbase-cxx-client/test/utils/integration_test_guard.cxx +2 -1
- package/deps/couchbase-cxx-client/test/utils/logger.cxx +3 -1
- package/deps/couchbase-cxx-client/test/utils/server_version.hxx +31 -15
- package/deps/couchbase-cxx-client/test/utils/test_context.cxx +8 -0
- package/deps/couchbase-cxx-client/tools/get.cxx +9 -8
- package/deps/couchbase-cxx-client/tools/pillowfight.cxx +175 -75
- package/deps/couchbase-cxx-client/tools/version.cxx +4 -2
- package/dist/binding.d.ts +1 -1
- package/dist/binding.js +3 -2
- package/package.json +96 -1
- package/scripts/createPlatformPackages.js +108 -0
- package/scripts/install.js +45 -0
- package/scripts/prebuilds.js +249 -0
- package/scripts/prune.js +124 -0
- package/src/jstocbpp_autogen.hpp +3 -2
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
#include "encoded_search_sort.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/search_sort_field.hxx>
|
|
21
|
+
|
|
22
|
+
namespace couchbase
|
|
23
|
+
{
|
|
24
|
+
auto
|
|
25
|
+
search_sort_field::descending(bool desc) -> search_sort_field&
|
|
26
|
+
{
|
|
27
|
+
descending_ = desc;
|
|
28
|
+
return *this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
auto
|
|
32
|
+
search_sort_field::type(search_sort_field_type value) -> search_sort_field&
|
|
33
|
+
{
|
|
34
|
+
type_ = value;
|
|
35
|
+
return *this;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
auto
|
|
39
|
+
search_sort_field::mode(search_sort_field_mode value) -> search_sort_field&
|
|
40
|
+
{
|
|
41
|
+
mode_ = value;
|
|
42
|
+
return *this;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
auto
|
|
46
|
+
search_sort_field::missing(search_sort_field_missing value) -> search_sort_field&
|
|
47
|
+
{
|
|
48
|
+
missing_ = value;
|
|
49
|
+
return *this;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
auto
|
|
53
|
+
search_sort_field::encode() const -> encoded_search_sort
|
|
54
|
+
{
|
|
55
|
+
encoded_search_sort built;
|
|
56
|
+
built.sort = {
|
|
57
|
+
{ "by", "field" },
|
|
58
|
+
{ "field", field_ },
|
|
59
|
+
};
|
|
60
|
+
if (const auto& desc = descending_; desc.has_value()) {
|
|
61
|
+
built.sort["desc"] = desc.value();
|
|
62
|
+
}
|
|
63
|
+
if (const auto& type = type_; type.has_value()) {
|
|
64
|
+
switch (type.value()) {
|
|
65
|
+
case search_sort_field_type::automatic:
|
|
66
|
+
built.sort["type"] = "auto";
|
|
67
|
+
break;
|
|
68
|
+
case search_sort_field_type::string:
|
|
69
|
+
built.sort["type"] = "string";
|
|
70
|
+
break;
|
|
71
|
+
case search_sort_field_type::number:
|
|
72
|
+
built.sort["type"] = "number";
|
|
73
|
+
break;
|
|
74
|
+
case search_sort_field_type::date:
|
|
75
|
+
built.sort["type"] = "date";
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (const auto& mode = mode_; mode.has_value()) {
|
|
80
|
+
switch (mode.value()) {
|
|
81
|
+
case search_sort_field_mode::server_default:
|
|
82
|
+
built.sort["mode"] = "default";
|
|
83
|
+
break;
|
|
84
|
+
case search_sort_field_mode::min:
|
|
85
|
+
built.sort["mode"] = "min";
|
|
86
|
+
break;
|
|
87
|
+
case search_sort_field_mode::max:
|
|
88
|
+
built.sort["mode"] = "max";
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (const auto& missing = missing_; missing.has_value()) {
|
|
93
|
+
switch (missing.value()) {
|
|
94
|
+
case search_sort_field_missing::last:
|
|
95
|
+
built.sort["missing"] = "last";
|
|
96
|
+
break;
|
|
97
|
+
case search_sort_field_missing::first:
|
|
98
|
+
built.sort["missing"] = "first";
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return built;
|
|
103
|
+
}
|
|
104
|
+
} // namespace couchbase
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
#include "encoded_search_sort.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/search_sort_id.hxx>
|
|
21
|
+
|
|
22
|
+
namespace couchbase
|
|
23
|
+
{
|
|
24
|
+
auto
|
|
25
|
+
search_sort_id::descending(bool desc) -> search_sort_id&
|
|
26
|
+
{
|
|
27
|
+
descending_ = desc;
|
|
28
|
+
return *this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
auto
|
|
32
|
+
search_sort_id::encode() const -> encoded_search_sort
|
|
33
|
+
{
|
|
34
|
+
encoded_search_sort built;
|
|
35
|
+
built.sort = {
|
|
36
|
+
{ "by", "id" },
|
|
37
|
+
};
|
|
38
|
+
if (const auto& desc = descending_; desc.has_value()) {
|
|
39
|
+
built.sort["desc"] = desc.value();
|
|
40
|
+
}
|
|
41
|
+
return built;
|
|
42
|
+
}
|
|
43
|
+
} // namespace couchbase
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
#include "encoded_search_sort.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/search_sort_score.hxx>
|
|
21
|
+
|
|
22
|
+
namespace couchbase
|
|
23
|
+
{
|
|
24
|
+
auto
|
|
25
|
+
search_sort_score::descending(bool desc) -> search_sort_score&
|
|
26
|
+
{
|
|
27
|
+
descending_ = desc;
|
|
28
|
+
return *this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
auto
|
|
32
|
+
search_sort_score::encode() const -> encoded_search_sort
|
|
33
|
+
{
|
|
34
|
+
encoded_search_sort built;
|
|
35
|
+
built.sort = {
|
|
36
|
+
{ "by", "score" },
|
|
37
|
+
};
|
|
38
|
+
if (const auto& desc = descending_; desc.has_value()) {
|
|
39
|
+
built.sort["desc"] = desc.value();
|
|
40
|
+
}
|
|
41
|
+
return built;
|
|
42
|
+
}
|
|
43
|
+
} // namespace couchbase
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
#include "encoded_search_facet.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/term_facet.hxx>
|
|
21
|
+
|
|
22
|
+
namespace couchbase
|
|
23
|
+
{
|
|
24
|
+
auto
|
|
25
|
+
term_facet::encode() const -> encoded_search_facet
|
|
26
|
+
{
|
|
27
|
+
encoded_search_facet built;
|
|
28
|
+
built.facet = {
|
|
29
|
+
{ "field", field_ },
|
|
30
|
+
};
|
|
31
|
+
if (size_) {
|
|
32
|
+
built.facet["size"] = size_.value();
|
|
33
|
+
}
|
|
34
|
+
return built;
|
|
35
|
+
}
|
|
36
|
+
} // namespace couchbase
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
#include "internal_term_facet_result.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/term_facet_result.hxx>
|
|
21
|
+
|
|
22
|
+
namespace couchbase
|
|
23
|
+
{
|
|
24
|
+
term_facet_result::term_facet_result(internal_term_facet_result internal)
|
|
25
|
+
: internal_{ std::make_unique<internal_term_facet_result>(std::move(internal)) }
|
|
26
|
+
{
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
auto
|
|
30
|
+
term_facet_result::name() const -> const std::string&
|
|
31
|
+
{
|
|
32
|
+
return internal_->name();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
auto
|
|
36
|
+
term_facet_result::field() const -> const std::string&
|
|
37
|
+
{
|
|
38
|
+
return internal_->field();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
auto
|
|
42
|
+
term_facet_result::total() const -> std::uint64_t
|
|
43
|
+
{
|
|
44
|
+
return internal_->total();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
auto
|
|
48
|
+
term_facet_result::missing() const -> std::uint64_t
|
|
49
|
+
{
|
|
50
|
+
return internal_->missing();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
auto
|
|
54
|
+
term_facet_result::other() const -> std::uint64_t
|
|
55
|
+
{
|
|
56
|
+
return internal_->other();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
auto
|
|
60
|
+
term_facet_result::terms() const -> const std::vector<search_term_range>&
|
|
61
|
+
{
|
|
62
|
+
return internal_->terms();
|
|
63
|
+
}
|
|
64
|
+
} // namespace couchbase
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
#include "encoded_search_query.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/term_query.hxx>
|
|
21
|
+
|
|
22
|
+
namespace couchbase
|
|
23
|
+
{
|
|
24
|
+
auto
|
|
25
|
+
term_query::encode() const -> encoded_search_query
|
|
26
|
+
{
|
|
27
|
+
encoded_search_query built;
|
|
28
|
+
built.query = tao::json::empty_object;
|
|
29
|
+
if (boost_) {
|
|
30
|
+
built.query["boost"] = boost_.value();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
built.query["term"] = term_;
|
|
34
|
+
if (field_) {
|
|
35
|
+
built.query["field"] = field_.value();
|
|
36
|
+
}
|
|
37
|
+
if (fuzziness_) {
|
|
38
|
+
built.query["fuzziness"] = fuzziness_.value();
|
|
39
|
+
}
|
|
40
|
+
if (prefix_length_) {
|
|
41
|
+
built.query["prefix_length"] = prefix_length_.value();
|
|
42
|
+
}
|
|
43
|
+
if (operator_) {
|
|
44
|
+
switch (operator_.value()) {
|
|
45
|
+
case match_operator::logical_or:
|
|
46
|
+
built.query["operator"] = "or";
|
|
47
|
+
break;
|
|
48
|
+
case match_operator::logical_and:
|
|
49
|
+
built.query["operator"] = "and";
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return built;
|
|
55
|
+
}
|
|
56
|
+
} // namespace couchbase
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
#include "encoded_search_query.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/term_range_query.hxx>
|
|
21
|
+
|
|
22
|
+
#include <couchbase/error_codes.hxx>
|
|
23
|
+
|
|
24
|
+
namespace couchbase
|
|
25
|
+
{
|
|
26
|
+
auto
|
|
27
|
+
term_range_query::encode() const -> encoded_search_query
|
|
28
|
+
{
|
|
29
|
+
if ((!min_ || min_->empty()) && (!max_ || max_->empty())) {
|
|
30
|
+
return { errc::common::invalid_argument };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
encoded_search_query built;
|
|
34
|
+
built.query = tao::json::empty_object;
|
|
35
|
+
if (boost_) {
|
|
36
|
+
built.query["boost"] = boost_.value();
|
|
37
|
+
}
|
|
38
|
+
if (field_) {
|
|
39
|
+
built.query["field"] = field_.value();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (min_) {
|
|
43
|
+
built.query["min"] = min_.value();
|
|
44
|
+
if (inclusive_min_.has_value()) {
|
|
45
|
+
built.query["inclusive_min"] = inclusive_min_.value();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (max_) {
|
|
49
|
+
built.query["max"] = max_.value();
|
|
50
|
+
if (inclusive_max_.has_value()) {
|
|
51
|
+
built.query["inclusive_max"] = inclusive_max_.value();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return built;
|
|
56
|
+
}
|
|
57
|
+
} // namespace couchbase
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
#include "encoded_search_query.hxx"
|
|
19
|
+
|
|
20
|
+
#include <couchbase/wildcard_query.hxx>
|
|
21
|
+
|
|
22
|
+
namespace couchbase
|
|
23
|
+
{
|
|
24
|
+
auto
|
|
25
|
+
wildcard_query::encode() const -> encoded_search_query
|
|
26
|
+
{
|
|
27
|
+
encoded_search_query built;
|
|
28
|
+
built.query = tao::json::empty_object;
|
|
29
|
+
if (boost_) {
|
|
30
|
+
built.query["boost"] = boost_.value();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
built.query["wildcard"] = wildcard_;
|
|
34
|
+
if (field_) {
|
|
35
|
+
built.query["field"] = field_.value();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return built;
|
|
39
|
+
}
|
|
40
|
+
} // namespace couchbase
|
|
@@ -59,9 +59,13 @@ struct mcbp_command : public std::enable_shared_from_this<mcbp_command<Manager,
|
|
|
59
59
|
mcbp_command_handler handler_{};
|
|
60
60
|
std::shared_ptr<Manager> manager_{};
|
|
61
61
|
std::chrono::milliseconds timeout_{};
|
|
62
|
-
std::string id_{
|
|
62
|
+
std::string id_{
|
|
63
|
+
fmt::format("{:02x}/{}", static_cast<std::uint8_t>(encoded_request_type::body_type::opcode), uuid::to_string(uuid::random()))
|
|
64
|
+
};
|
|
63
65
|
std::shared_ptr<couchbase::tracing::request_span> span_{ nullptr };
|
|
64
66
|
std::shared_ptr<couchbase::tracing::request_span> parent_span{ nullptr };
|
|
67
|
+
std::optional<std::string> last_dispatched_from_{};
|
|
68
|
+
std::optional<std::string> last_dispatched_to_{};
|
|
65
69
|
|
|
66
70
|
mcbp_command(asio::io_context& ctx, std::shared_ptr<Manager> manager, Request req, std::chrono::milliseconds default_timeout)
|
|
67
71
|
: deadline(ctx)
|
|
@@ -109,7 +113,10 @@ struct mcbp_command : public std::enable_shared_from_this<mcbp_command<Manager,
|
|
|
109
113
|
handler_ = nullptr;
|
|
110
114
|
}
|
|
111
115
|
}
|
|
112
|
-
invoke_handler(request.retries.idempotent()
|
|
116
|
+
invoke_handler(request.retries.idempotent() || !opaque_.has_value()
|
|
117
|
+
? errc::common::unambiguous_timeout // safe to retry or has not been sent to the server
|
|
118
|
+
: errc::common::ambiguous_timeout // non-idempotent and has been sent to the server
|
|
119
|
+
);
|
|
113
120
|
}
|
|
114
121
|
|
|
115
122
|
void invoke_handler(std::error_code ec, std::optional<io::mcbp_message>&& msg = {})
|