couchbase 3.7.0 → 3.8.0
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.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/ext/CMakeLists.txt +4 -1
- data/ext/cache/extconf_include.rb +4 -3
- data/ext/cache/mozilla-ca-bundle.crt +66 -93
- data/ext/cache/mozilla-ca-bundle.sha256 +1 -1
- data/ext/couchbase/CMakeLists.txt +24 -11
- data/ext/couchbase/cmake/APKBUILD.in +17 -1
- data/ext/couchbase/cmake/Bundler.cmake +9 -1
- data/ext/couchbase/cmake/Cache.cmake +48 -19
- data/ext/couchbase/cmake/CompilerOptions.cmake +3 -1
- data/ext/couchbase/cmake/OpenSSL.cmake +10 -2
- data/ext/couchbase/cmake/Packaging.cmake +48 -8
- data/ext/couchbase/cmake/ThirdPartyDependencies.cmake +43 -1
- data/ext/couchbase/cmake/build_config.hxx.in +2 -0
- data/ext/couchbase/cmake/couchbase-cxx-client.spec.in +18 -0
- data/ext/couchbase/cmake/tarball_glob.txt +10 -0
- data/ext/couchbase/core/app_telemetry_meter.cxx +1 -0
- data/ext/couchbase/core/app_telemetry_reporter.cxx +45 -43
- data/ext/couchbase/core/app_telemetry_reporter.hxx +4 -3
- data/ext/couchbase/core/bucket.cxx +128 -13
- data/ext/couchbase/core/bucket.hxx +12 -2
- data/ext/couchbase/core/cluster.cxx +304 -152
- data/ext/couchbase/core/cluster.hxx +32 -0
- data/ext/couchbase/core/cluster_credentials.cxx +25 -0
- data/ext/couchbase/core/cluster_credentials.hxx +5 -0
- data/ext/couchbase/core/cluster_label_listener.cxx +72 -0
- data/ext/couchbase/core/cluster_label_listener.hxx +46 -0
- data/ext/couchbase/core/cluster_options.hxx +4 -0
- data/ext/couchbase/core/deprecation_utils.hxx +26 -0
- data/ext/couchbase/core/error.hxx +27 -0
- data/ext/couchbase/core/free_form_http_request.hxx +0 -2
- data/ext/couchbase/core/http_component.cxx +12 -48
- data/ext/couchbase/core/impl/analytics.cxx +3 -2
- data/ext/couchbase/core/impl/analytics.hxx +2 -1
- data/ext/couchbase/core/impl/analytics_index_manager.cxx +249 -137
- data/ext/couchbase/core/impl/binary_collection.cxx +134 -58
- data/ext/couchbase/core/impl/bucket_manager.cxx +87 -35
- data/ext/couchbase/core/impl/collection.cxx +560 -245
- data/ext/couchbase/core/impl/collection_manager.cxx +89 -49
- data/ext/couchbase/core/impl/dns_srv_tracker.cxx +4 -4
- data/ext/couchbase/core/impl/error.cxx +20 -13
- data/ext/couchbase/core/impl/error.hxx +15 -10
- data/ext/couchbase/core/impl/get_all_replicas.hxx +1 -1
- data/ext/couchbase/core/impl/get_any_replica.hxx +2 -1
- data/ext/couchbase/core/impl/get_replica.hxx +2 -0
- data/ext/couchbase/core/impl/lookup_in_replica.hxx +1 -1
- data/ext/couchbase/core/impl/observability_recorder.cxx +161 -0
- data/ext/couchbase/core/impl/observability_recorder.hxx +77 -0
- data/ext/couchbase/core/impl/observe_seqno.hxx +2 -0
- data/ext/couchbase/core/impl/public_bucket.cxx +31 -7
- data/ext/couchbase/core/impl/public_cluster.cxx +107 -19
- data/ext/couchbase/core/impl/query.cxx +6 -3
- data/ext/couchbase/core/impl/query.hxx +3 -1
- data/ext/couchbase/core/impl/query_index_manager.cxx +267 -102
- data/ext/couchbase/core/impl/scope.cxx +53 -11
- data/ext/couchbase/core/impl/search.cxx +8 -4
- data/ext/couchbase/core/impl/search.hxx +6 -2
- data/ext/couchbase/core/impl/search_index_manager.cxx +131 -41
- data/ext/couchbase/core/impl/with_cancellation.hxx +75 -0
- data/ext/couchbase/core/io/config_tracker.cxx +9 -9
- data/ext/couchbase/core/io/config_tracker.hxx +2 -1
- data/ext/couchbase/core/io/http_command.hxx +98 -49
- data/ext/couchbase/core/io/http_context.hxx +2 -0
- data/ext/couchbase/core/io/http_session.cxx +23 -10
- data/ext/couchbase/core/io/http_session.hxx +17 -9
- data/ext/couchbase/core/io/http_session_manager.hxx +163 -228
- data/ext/couchbase/core/io/http_traits.hxx +0 -7
- data/ext/couchbase/core/io/mcbp_command.hxx +123 -44
- data/ext/couchbase/core/io/mcbp_session.cxx +251 -26
- data/ext/couchbase/core/io/mcbp_session.hxx +9 -1
- data/ext/couchbase/core/io/mcbp_traits.hxx +0 -8
- data/ext/couchbase/core/io/streams.cxx +3 -3
- data/ext/couchbase/core/io/streams.hxx +3 -2
- data/ext/couchbase/core/meta/features.hxx +15 -0
- data/ext/couchbase/core/meta/version.cxx +13 -0
- data/ext/couchbase/core/meta/version.hxx +3 -0
- data/ext/couchbase/core/metrics/constants.hxx +23 -0
- data/ext/couchbase/core/metrics/logging_meter.cxx +5 -5
- data/ext/couchbase/core/metrics/meter_wrapper.cxx +65 -63
- data/ext/couchbase/core/metrics/meter_wrapper.hxx +12 -10
- data/ext/couchbase/core/operations/document_analytics.hxx +0 -5
- data/ext/couchbase/core/operations/document_append.hxx +0 -4
- data/ext/couchbase/core/operations/document_decrement.hxx +0 -5
- data/ext/couchbase/core/operations/document_exists.hxx +0 -7
- data/ext/couchbase/core/operations/document_get.hxx +0 -7
- data/ext/couchbase/core/operations/document_get_all_replicas.hxx +77 -27
- data/ext/couchbase/core/operations/document_get_and_lock.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_and_touch.hxx +0 -9
- data/ext/couchbase/core/operations/document_get_any_replica.hxx +83 -2
- data/ext/couchbase/core/operations/document_get_projected.hxx +0 -9
- data/ext/couchbase/core/operations/document_increment.hxx +0 -5
- data/ext/couchbase/core/operations/document_insert.hxx +0 -4
- data/ext/couchbase/core/operations/document_lookup_in.hxx +0 -9
- data/ext/couchbase/core/operations/document_lookup_in_all_replicas.hxx +46 -4
- data/ext/couchbase/core/operations/document_lookup_in_any_replica.hxx +121 -43
- data/ext/couchbase/core/operations/document_mutate_in.hxx +0 -5
- data/ext/couchbase/core/operations/document_prepend.hxx +0 -4
- data/ext/couchbase/core/operations/document_query.hxx +0 -4
- data/ext/couchbase/core/operations/document_remove.hxx +0 -4
- data/ext/couchbase/core/operations/document_replace.hxx +0 -4
- data/ext/couchbase/core/operations/document_search.hxx +0 -7
- data/ext/couchbase/core/operations/document_touch.hxx +0 -7
- data/ext/couchbase/core/operations/document_unlock.hxx +0 -6
- data/ext/couchbase/core/operations/document_upsert.hxx +0 -4
- data/ext/couchbase/core/operations/document_view.cxx +2 -0
- data/ext/couchbase/core/operations/document_view.hxx +10 -13
- data/ext/couchbase/core/operations/http_noop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataset_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_dataverse_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_get_pending_mutations.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_connect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_disconnect.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/analytics_link_replace.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_flush.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/bucket_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/change_password.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_describe.hxx +2 -0
- data/ext/couchbase/core/operations/management/cluster_developer_preview_enable.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/collection_update.hxx +2 -0
- data/ext/couchbase/core/operations/management/collections_manifest_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/error_utils.cxx +4 -1
- data/ext/couchbase/core/operations/management/eventing_deploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_drop_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_all_functions.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_get_status.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_pause_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_resume_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_undeploy_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/eventing_upsert_function.hxx +2 -0
- data/ext/couchbase/core/operations/management/freeform.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/group_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_build_deferred.hxx +68 -30
- data/ext/couchbase/core/operations/management/query_index_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/query_index_get_all.hxx +4 -3
- data/ext/couchbase/core/operations/management/query_index_get_all_deferred.hxx +2 -1
- data/ext/couchbase/core/operations/management/role_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_create.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/scope_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_analyze_document.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_ingest.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_plan_freeze.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_control_query.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_documents_count.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_get_stats.hxx +2 -0
- data/ext/couchbase/core/operations/management/search_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/user_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_drop.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_get_all.hxx +2 -0
- data/ext/couchbase/core/operations/management/view_index_upsert.hxx +2 -0
- data/ext/couchbase/core/operations/operation_traits.hxx +6 -0
- data/ext/couchbase/core/operations.hxx +0 -1
- data/ext/couchbase/core/operations_fwd.hxx +8 -0
- data/ext/couchbase/core/origin.cxx +67 -12
- data/ext/couchbase/core/origin.hxx +13 -8
- data/ext/couchbase/core/orphan_reporter.cxx +164 -0
- data/ext/couchbase/core/orphan_reporter.hxx +65 -0
- data/ext/couchbase/core/sasl/CMakeLists.txt +1 -0
- data/ext/couchbase/core/sasl/client.cc +6 -0
- data/ext/couchbase/core/sasl/mechanism.cc +2 -1
- data/ext/couchbase/core/sasl/mechanism.h +2 -1
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.cc +41 -0
- data/ext/couchbase/core/sasl/oauthbearer/oauthbearer.h +47 -0
- data/ext/couchbase/core/tls_context_provider.cxx +44 -0
- data/ext/couchbase/core/tls_context_provider.hxx +44 -0
- data/ext/couchbase/core/tracing/attribute_helpers.hxx +45 -0
- data/ext/couchbase/core/tracing/constants.hxx +148 -68
- data/ext/couchbase/core/tracing/threshold_logging_options.hxx +0 -3
- data/ext/couchbase/core/tracing/threshold_logging_tracer.cxx +122 -170
- data/ext/couchbase/core/tracing/tracer_wrapper.cxx +17 -24
- data/ext/couchbase/core/tracing/tracer_wrapper.hxx +8 -10
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.cxx +114 -0
- data/ext/couchbase/core/tracing/wrapper_sdk_tracer.hxx +85 -0
- data/ext/couchbase/core/transactions/attempt_context_impl.cxx +16 -14
- data/ext/couchbase/core/transactions/attempt_context_impl.hxx +4 -4
- data/ext/couchbase/core/transactions/transactions.cxx +1 -1
- data/ext/couchbase/core/transactions/transactions_cleanup.cxx +1 -2
- data/ext/couchbase/core/utils/byteswap.hxx +12 -0
- data/ext/couchbase/core/utils/concurrent_fixed_priority_queue.hxx +102 -0
- data/ext/couchbase/core/utils/connection_string.cxx +2 -0
- data/ext/couchbase/couchbase/certificate_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/cluster.hxx +47 -0
- data/ext/couchbase/couchbase/cluster_options.hxx +16 -0
- data/ext/couchbase/couchbase/collection.hxx +60 -15
- data/ext/couchbase/couchbase/error_codes.hxx +48 -48
- data/ext/couchbase/couchbase/jwt_authenticator.hxx +52 -0
- data/ext/couchbase/couchbase/metrics/meter.hxx +2 -1
- data/ext/couchbase/couchbase/metrics/otel_meter.hxx +75 -80
- data/ext/couchbase/couchbase/network_options.hxx +19 -0
- data/ext/couchbase/couchbase/password_authenticator.hxx +1 -0
- data/ext/couchbase/couchbase/tracing/otel_tracer.hxx +15 -17
- data/ext/couchbase/couchbase/tracing/request_span.hxx +2 -2
- data/ext/couchbase.cxx +4 -0
- data/ext/extconf.rb +1 -0
- data/ext/rcb_analytics.cxx +157 -47
- data/ext/rcb_backend.cxx +118 -71
- data/ext/rcb_buckets.cxx +39 -16
- data/ext/rcb_collections.cxx +36 -12
- data/ext/rcb_crud.cxx +587 -294
- data/ext/rcb_hdr_histogram.cxx +219 -0
- data/ext/rcb_hdr_histogram.hxx +28 -0
- data/ext/rcb_multi.cxx +142 -59
- data/ext/rcb_observability.cxx +132 -0
- data/ext/rcb_observability.hxx +49 -0
- data/ext/rcb_query.cxx +77 -27
- data/ext/rcb_search.cxx +92 -31
- data/ext/rcb_users.cxx +69 -26
- data/ext/rcb_utils.cxx +91 -0
- data/ext/rcb_utils.hxx +141 -168
- data/ext/rcb_views.cxx +36 -12
- data/lib/active_support/cache/couchbase_store.rb +6 -6
- data/lib/couchbase/authenticator.rb +14 -0
- data/lib/couchbase/binary_collection.rb +37 -22
- data/lib/couchbase/bucket.rb +46 -31
- data/lib/couchbase/cluster.rb +146 -61
- data/lib/couchbase/collection.rb +257 -186
- data/lib/couchbase/datastructures/couchbase_list.rb +81 -50
- data/lib/couchbase/datastructures/couchbase_map.rb +86 -50
- data/lib/couchbase/datastructures/couchbase_queue.rb +64 -38
- data/lib/couchbase/datastructures/couchbase_set.rb +57 -41
- data/lib/couchbase/deprecations.rb +1 -1
- data/lib/couchbase/diagnostics.rb +8 -8
- data/lib/couchbase/errors.rb +6 -0
- data/lib/couchbase/management/analytics_index_manager.rb +90 -59
- data/lib/couchbase/management/bucket_manager.rb +73 -45
- data/lib/couchbase/management/collection_manager.rb +86 -43
- data/lib/couchbase/management/collection_query_index_manager.rb +56 -33
- data/lib/couchbase/management/query_index_manager.rb +88 -36
- data/lib/couchbase/management/scope_search_index_manager.rb +119 -52
- data/lib/couchbase/management/search_index_manager.rb +401 -178
- data/lib/couchbase/management/user_manager.rb +343 -174
- data/lib/couchbase/management/view_index_manager.rb +166 -73
- data/lib/couchbase/metrics/logging_meter.rb +108 -0
- data/lib/couchbase/metrics/logging_value_recorder.rb +50 -0
- data/lib/couchbase/metrics/meter.rb +27 -0
- data/lib/couchbase/metrics/noop_meter.rb +30 -0
- data/lib/couchbase/metrics/noop_value_recorder.rb +27 -0
- data/lib/couchbase/metrics/value_recorder.rb +25 -0
- data/lib/couchbase/options.rb +69 -3
- data/lib/couchbase/protostellar/cluster.rb +3 -0
- data/lib/couchbase/scope.rb +62 -48
- data/lib/couchbase/search_options.rb +18 -18
- data/lib/couchbase/tracing/noop_span.rb +29 -0
- data/lib/couchbase/tracing/noop_tracer.rb +29 -0
- data/lib/couchbase/tracing/request_span.rb +34 -0
- data/lib/couchbase/tracing/request_tracer.rb +28 -0
- data/lib/couchbase/tracing/threshold_logging_span.rb +112 -0
- data/lib/couchbase/tracing/threshold_logging_tracer.rb +231 -0
- data/lib/couchbase/utils/hdr_histogram.rb +55 -0
- data/lib/couchbase/utils/observability.rb +257 -0
- data/lib/couchbase/utils/observability_constants.rb +200 -0
- data/lib/couchbase/utils/stdlib_logger_adapter.rb +1 -3
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase.rb +2 -2
- metadata +58 -6
|
@@ -15,92 +15,374 @@
|
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
17
|
require "couchbase/errors"
|
|
18
|
+
require "couchbase/options"
|
|
18
19
|
|
|
19
20
|
module Couchbase
|
|
20
21
|
module Management
|
|
22
|
+
module Options
|
|
23
|
+
module Search
|
|
24
|
+
# Options for {SearchIndexManager#get_index}
|
|
25
|
+
class GetIndex < ::Couchbase::Options::Base
|
|
26
|
+
# Creates an instance of options for {SearchIndexManager#get_index}
|
|
27
|
+
#
|
|
28
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
29
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
30
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
31
|
+
#
|
|
32
|
+
# @yieldparam [GetIndex] self
|
|
33
|
+
def initialize(timeout: nil,
|
|
34
|
+
retry_strategy: nil,
|
|
35
|
+
parent_span: nil)
|
|
36
|
+
super
|
|
37
|
+
yield self if block_given?
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# @api private
|
|
41
|
+
DEFAULT = new.freeze
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Options for {SearchIndexManager#get_all_indexes}
|
|
45
|
+
class GetAllIndexes < ::Couchbase::Options::Base
|
|
46
|
+
# Creates an instance of options for {SearchIndexManager#get_all_indexes}
|
|
47
|
+
#
|
|
48
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
49
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
50
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
51
|
+
#
|
|
52
|
+
# @yieldparam [GetAllIndexes] self
|
|
53
|
+
def initialize(timeout: nil,
|
|
54
|
+
retry_strategy: nil,
|
|
55
|
+
parent_span: nil)
|
|
56
|
+
super
|
|
57
|
+
yield self if block_given?
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# @api private
|
|
61
|
+
DEFAULT = new.freeze
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Options for {SearchIndexManager#upsert_index}
|
|
65
|
+
class UpsertIndex < ::Couchbase::Options::Base
|
|
66
|
+
# Creates an instance of options for {SearchIndexManager#upsert_index}
|
|
67
|
+
#
|
|
68
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
69
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
70
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
71
|
+
#
|
|
72
|
+
# @yieldparam [UpsertIndex] self
|
|
73
|
+
def initialize(timeout: nil,
|
|
74
|
+
retry_strategy: nil,
|
|
75
|
+
parent_span: nil)
|
|
76
|
+
super
|
|
77
|
+
yield self if block_given?
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @api private
|
|
81
|
+
DEFAULT = new.freeze
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Options for {SearchIndexManager#drop_index}
|
|
85
|
+
class DropIndex < ::Couchbase::Options::Base
|
|
86
|
+
# Creates an instance of options for {SearchIndexManager#drop_index}
|
|
87
|
+
#
|
|
88
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
89
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
90
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
91
|
+
#
|
|
92
|
+
# @yieldparam [DropIndex] self
|
|
93
|
+
def initialize(timeout: nil,
|
|
94
|
+
retry_strategy: nil,
|
|
95
|
+
parent_span: nil)
|
|
96
|
+
super
|
|
97
|
+
yield self if block_given?
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# @api private
|
|
101
|
+
DEFAULT = new.freeze
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Options for {SearchIndexManager#get_indexed_documents_count}
|
|
105
|
+
class GetIndexedDocumentsCount < ::Couchbase::Options::Base
|
|
106
|
+
# Creates an instance of options for {SearchIndexManager#get_indexed_documents_count}
|
|
107
|
+
#
|
|
108
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
109
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
110
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
111
|
+
#
|
|
112
|
+
# @yieldparam [GetIndexedDocumentsCount] self
|
|
113
|
+
def initialize(timeout: nil,
|
|
114
|
+
retry_strategy: nil,
|
|
115
|
+
parent_span: nil)
|
|
116
|
+
super
|
|
117
|
+
yield self if block_given?
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# @api private
|
|
121
|
+
DEFAULT = new.freeze
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Options for {SearchIndexManager#get_index_stats}
|
|
125
|
+
class GetIndexStats < ::Couchbase::Options::Base
|
|
126
|
+
# Creates an instance of options for {SearchIndexManager#get_index_stats}
|
|
127
|
+
#
|
|
128
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
129
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
130
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
131
|
+
#
|
|
132
|
+
# @yieldparam [GetIndexStats] self
|
|
133
|
+
def initialize(timeout: nil,
|
|
134
|
+
retry_strategy: nil,
|
|
135
|
+
parent_span: nil)
|
|
136
|
+
super
|
|
137
|
+
yield self if block_given?
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @api private
|
|
141
|
+
DEFAULT = new.freeze
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Options for {SearchIndexManager#pause_ingest}
|
|
145
|
+
class PauseIngest < ::Couchbase::Options::Base
|
|
146
|
+
# Creates an instance of options for {SearchIndexManager#pause_ingest}
|
|
147
|
+
#
|
|
148
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
149
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
150
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
151
|
+
#
|
|
152
|
+
# @yieldparam [PauseIngest] self
|
|
153
|
+
def initialize(timeout: nil,
|
|
154
|
+
retry_strategy: nil,
|
|
155
|
+
parent_span: nil)
|
|
156
|
+
super
|
|
157
|
+
yield self if block_given?
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# @api private
|
|
161
|
+
DEFAULT = new.freeze
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Options for {SearchIndexManager#resume_ingest}
|
|
165
|
+
class ResumeIngest < ::Couchbase::Options::Base
|
|
166
|
+
# Creates an instance of options for {SearchIndexManager#resume_ingest}
|
|
167
|
+
#
|
|
168
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
169
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
170
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
171
|
+
#
|
|
172
|
+
# @yieldparam [ResumeIngest] self
|
|
173
|
+
def initialize(timeout: nil,
|
|
174
|
+
retry_strategy: nil,
|
|
175
|
+
parent_span: nil)
|
|
176
|
+
super
|
|
177
|
+
yield self if block_given?
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
# @api private
|
|
181
|
+
DEFAULT = new.freeze
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Options for {SearchIndexManager#allow_querying}
|
|
185
|
+
class AllowQuerying < ::Couchbase::Options::Base
|
|
186
|
+
# Creates an instance of options for {SearchIndexManager#allow_querying}
|
|
187
|
+
#
|
|
188
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
189
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
190
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
191
|
+
#
|
|
192
|
+
# @yieldparam [AllowQuerying] self
|
|
193
|
+
def initialize(timeout: nil,
|
|
194
|
+
retry_strategy: nil,
|
|
195
|
+
parent_span: nil)
|
|
196
|
+
super
|
|
197
|
+
yield self if block_given?
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
# @api private
|
|
201
|
+
DEFAULT = new.freeze
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Options for {SearchIndexManager#disallow_querying}
|
|
205
|
+
class DisallowQuerying < ::Couchbase::Options::Base
|
|
206
|
+
# Creates an instance of options for {SearchIndexManager#disallow_querying}
|
|
207
|
+
#
|
|
208
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
209
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
210
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
211
|
+
#
|
|
212
|
+
# @yieldparam [DisallowQuerying] self
|
|
213
|
+
def initialize(timeout: nil,
|
|
214
|
+
retry_strategy: nil,
|
|
215
|
+
parent_span: nil)
|
|
216
|
+
super
|
|
217
|
+
yield self if block_given?
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# @api private
|
|
221
|
+
DEFAULT = new.freeze
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# Options for {SearchIndexManager#freeze_plan}
|
|
225
|
+
class FreezePlan < ::Couchbase::Options::Base
|
|
226
|
+
# Creates an instance of options for {SearchIndexManager#freeze_plan}
|
|
227
|
+
#
|
|
228
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
229
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
230
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
231
|
+
#
|
|
232
|
+
# @yieldparam [FreezePlan] self
|
|
233
|
+
def initialize(timeout: nil,
|
|
234
|
+
retry_strategy: nil,
|
|
235
|
+
parent_span: nil)
|
|
236
|
+
super
|
|
237
|
+
yield self if block_given?
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# @api private
|
|
241
|
+
DEFAULT = new.freeze
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# Options for {SearchIndexManager#unfreeze_plan}
|
|
245
|
+
class UnfreezePlan < ::Couchbase::Options::Base
|
|
246
|
+
# Creates an instance of options for {SearchIndexManager#unfreeze_plan}
|
|
247
|
+
#
|
|
248
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
249
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
250
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
251
|
+
#
|
|
252
|
+
# @yieldparam [UnfreezePlan] self
|
|
253
|
+
def initialize(timeout: nil,
|
|
254
|
+
retry_strategy: nil,
|
|
255
|
+
parent_span: nil)
|
|
256
|
+
super
|
|
257
|
+
yield self if block_given?
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# @api private
|
|
261
|
+
DEFAULT = new.freeze
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Options for {SearchIndexManager#analyze_document}
|
|
265
|
+
class AnalyzeDocument < ::Couchbase::Options::Base
|
|
266
|
+
# Creates an instance of options for {SearchIndexManager#analyze_document}
|
|
267
|
+
#
|
|
268
|
+
# @param [Integer, #in_milliseconds, nil] timeout the time in milliseconds allowed for the operation to complete
|
|
269
|
+
# @param [Proc, nil] retry_strategy the custom retry strategy, if set
|
|
270
|
+
# @param [Span, nil] parent_span if set holds the parent span, that should be used for this request
|
|
271
|
+
#
|
|
272
|
+
# @yieldparam [AnalyzeDocument] self
|
|
273
|
+
def initialize(timeout: nil,
|
|
274
|
+
retry_strategy: nil,
|
|
275
|
+
parent_span: nil)
|
|
276
|
+
super
|
|
277
|
+
yield self if block_given?
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# @api private
|
|
281
|
+
DEFAULT = new.freeze
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
|
|
21
286
|
class SearchIndexManager
|
|
22
287
|
alias inspect to_s
|
|
23
288
|
|
|
24
289
|
# @param [Couchbase::Backend] backend
|
|
25
|
-
|
|
290
|
+
# @param [Couchbase::Observability::Wrapper] observability wrapper
|
|
291
|
+
#
|
|
292
|
+
# @api private
|
|
293
|
+
def initialize(backend, observability)
|
|
26
294
|
@backend = backend
|
|
295
|
+
@observability = observability
|
|
27
296
|
end
|
|
28
297
|
|
|
29
298
|
# Fetches an index from the server if it exists
|
|
30
299
|
#
|
|
31
300
|
# @param [String] index_name name of the index
|
|
32
|
-
# @param [
|
|
301
|
+
# @param [Options::Search::GetIndex] options
|
|
33
302
|
#
|
|
34
303
|
# @return [SearchIndex]
|
|
35
304
|
#
|
|
36
305
|
# @raise [ArgumentError]
|
|
37
306
|
# @raise [Error::IndexNotFound]
|
|
38
|
-
def get_index(index_name, options =
|
|
39
|
-
|
|
40
|
-
|
|
307
|
+
def get_index(index_name, options = Options::Search::GetIndex::DEFAULT)
|
|
308
|
+
@observability.record_operation(Observability::OP_SM_GET_INDEX, options.parent_span, self, :search) do |obs_handler|
|
|
309
|
+
res = @backend.search_index_get(nil, nil, index_name, options.timeout, obs_handler)
|
|
310
|
+
self.class.extract_search_index(res)
|
|
311
|
+
end
|
|
41
312
|
end
|
|
42
313
|
|
|
43
314
|
# Fetches all indexes from the server
|
|
44
315
|
#
|
|
45
|
-
# @param [
|
|
316
|
+
# @param [Options::Search::GetAllIndexes] options
|
|
46
317
|
#
|
|
47
318
|
# @return [Array<SearchIndex>]
|
|
48
|
-
def get_all_indexes(options =
|
|
49
|
-
|
|
50
|
-
|
|
319
|
+
def get_all_indexes(options = Options::Search::GetAllIndexes::DEFAULT)
|
|
320
|
+
@observability.record_operation(Observability::OP_SM_GET_ALL_INDEXES, options.parent_span, self, :search) do |obs_handler|
|
|
321
|
+
res = @backend.search_index_get_all(nil, nil, options.timeout, obs_handler)
|
|
322
|
+
res[:indexes].map { |idx| self.class.extract_search_index(idx) }
|
|
323
|
+
end
|
|
51
324
|
end
|
|
52
325
|
|
|
53
326
|
# Creates or updates the index
|
|
54
327
|
#
|
|
55
328
|
# @param [SearchIndex] index_definition the index definition
|
|
56
|
-
# @param [
|
|
329
|
+
# @param [Options::Search::UpsertIndex] options
|
|
57
330
|
#
|
|
58
331
|
# @return void
|
|
59
332
|
#
|
|
60
333
|
# @raise [ArgumentError] if name, type or source_type is empty
|
|
61
|
-
def upsert_index(index_definition, options =
|
|
62
|
-
@
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
334
|
+
def upsert_index(index_definition, options = Options::Search::UpsertIndex::DEFAULT)
|
|
335
|
+
@observability.record_operation(Observability::OP_SM_UPSERT_INDEX, options.parent_span, self, :search) do |obs_handler|
|
|
336
|
+
@backend.search_index_upsert(
|
|
337
|
+
nil,
|
|
338
|
+
nil,
|
|
339
|
+
{
|
|
340
|
+
name: index_definition.name,
|
|
341
|
+
type: index_definition.type,
|
|
342
|
+
uuid: index_definition.uuid,
|
|
343
|
+
params: (JSON.generate(index_definition.params) if index_definition.params),
|
|
344
|
+
source_name: index_definition.source_name,
|
|
345
|
+
source_type: index_definition.source_type,
|
|
346
|
+
source_uuid: index_definition.source_uuid,
|
|
347
|
+
source_params: (JSON.generate(index_definition.source_params) if index_definition.source_params),
|
|
348
|
+
plan_params: (JSON.generate(index_definition.plan_params) if index_definition.plan_params),
|
|
349
|
+
},
|
|
350
|
+
options.timeout,
|
|
351
|
+
obs_handler,
|
|
352
|
+
)
|
|
353
|
+
end
|
|
77
354
|
end
|
|
78
355
|
|
|
79
356
|
# Drops the index
|
|
80
357
|
#
|
|
81
358
|
# @param [String] index_name name of the index
|
|
82
|
-
# @param [
|
|
359
|
+
# @param [Options::Search::DropIndex] options
|
|
83
360
|
#
|
|
84
361
|
# @return void
|
|
85
362
|
#
|
|
86
363
|
# @raise [ArgumentError]
|
|
87
364
|
# @raise [Error::IndexNotFound]
|
|
88
|
-
def drop_index(index_name, options =
|
|
89
|
-
@
|
|
365
|
+
def drop_index(index_name, options = Options::Search::DropIndex::DEFAULT)
|
|
366
|
+
@observability.record_operation(Observability::OP_SM_DROP_INDEX, options.parent_span, self, :search) do |obs_handler|
|
|
367
|
+
@backend.search_index_drop(nil, nil, index_name, options.timeout, obs_handler)
|
|
368
|
+
end
|
|
90
369
|
end
|
|
91
370
|
|
|
92
371
|
# Retrieves the number of documents that have been indexed for an index
|
|
93
372
|
#
|
|
94
373
|
# @param [String] index_name name of the index
|
|
95
|
-
# @param [
|
|
374
|
+
# @param [Options::Search::GetIndexedDocumentsCount] options
|
|
96
375
|
#
|
|
97
376
|
# @return [Integer]
|
|
98
377
|
#
|
|
99
378
|
# @raise [ArgumentError]
|
|
100
379
|
# @raise [Error::IndexNotFound]
|
|
101
|
-
def get_indexed_documents_count(index_name, options =
|
|
102
|
-
|
|
103
|
-
|
|
380
|
+
def get_indexed_documents_count(index_name, options = Options::Search::GetIndexedDocumentsCount::DEFAULT)
|
|
381
|
+
@observability.record_operation(Observability::OP_SM_GET_INDEXED_DOCUMENTS_COUNT, options.parent_span, self,
|
|
382
|
+
:search) do |obs_handler|
|
|
383
|
+
res = @backend.search_index_get_documents_count(nil, nil, index_name, options.timeout, obs_handler)
|
|
384
|
+
res[:count]
|
|
385
|
+
end
|
|
104
386
|
end
|
|
105
387
|
|
|
106
388
|
# Retrieves metrics, timings and counters for a given index
|
|
@@ -108,15 +390,17 @@ module Couchbase
|
|
|
108
390
|
# @!macro uncommitted
|
|
109
391
|
#
|
|
110
392
|
# @param [String] index_name name of the index
|
|
111
|
-
# @param [
|
|
393
|
+
# @param [Options::Search::GetIndexStats] options
|
|
112
394
|
#
|
|
113
395
|
# @return [Integer]
|
|
114
396
|
#
|
|
115
397
|
# @raise [ArgumentError]
|
|
116
398
|
# @raise [Error::IndexNotFound]
|
|
117
|
-
def get_index_stats(index_name, options =
|
|
118
|
-
|
|
119
|
-
|
|
399
|
+
def get_index_stats(index_name, options = Options::Search::GetIndexStats::DEFAULT)
|
|
400
|
+
@observability.record_operation(Observability::OP_SM_GET_INDEX_STATS, options.parent_span, self, :search) do |obs_handler|
|
|
401
|
+
res = @backend.search_index_get_stats(index_name, options.timeout, obs_handler)
|
|
402
|
+
JSON.parse(res)
|
|
403
|
+
end
|
|
120
404
|
end
|
|
121
405
|
|
|
122
406
|
# Retrieves statistics on search service. Information is provided on documents, partition indexes, mutations,
|
|
@@ -124,237 +408,176 @@ module Couchbase
|
|
|
124
408
|
#
|
|
125
409
|
# @!macro uncommitted
|
|
126
410
|
#
|
|
127
|
-
# @param [
|
|
411
|
+
# @param [Options::Search::GetIndexStats] options
|
|
128
412
|
#
|
|
129
413
|
# @return [Integer]
|
|
130
414
|
#
|
|
131
415
|
# @raise [ArgumentError]
|
|
132
|
-
def get_stats(options =
|
|
133
|
-
|
|
134
|
-
|
|
416
|
+
def get_stats(options = Options::Search::GetIndexStats::DEFAULT)
|
|
417
|
+
@observability.record_operation(Observability::OP_SM_GET_STATS, options.parent_span, self, :search) do |obs_handler|
|
|
418
|
+
res = @backend.search_get_stats(options.timeout, obs_handler)
|
|
419
|
+
JSON.parse(res)
|
|
420
|
+
end
|
|
135
421
|
end
|
|
136
422
|
|
|
137
423
|
# Pauses updates and maintenance for the index
|
|
138
424
|
#
|
|
139
425
|
# @param [String] index_name name of the index
|
|
140
|
-
# @param [
|
|
426
|
+
# @param [Options::Search::PauseIngest] options
|
|
141
427
|
#
|
|
142
428
|
# @return void
|
|
143
429
|
#
|
|
144
430
|
# @raise [ArgumentError]
|
|
145
431
|
# @raise [Error::IndexNotFound]
|
|
146
|
-
def pause_ingest(index_name, options =
|
|
147
|
-
@
|
|
432
|
+
def pause_ingest(index_name, options = Options::Search::PauseIngest::DEFAULT)
|
|
433
|
+
@observability.record_operation(Observability::OP_SM_PAUSE_INGEST, options.parent_span, self, :search) do |obs_handler|
|
|
434
|
+
@backend.search_index_pause_ingest(nil, nil, index_name, options.timeout, obs_handler)
|
|
435
|
+
end
|
|
148
436
|
end
|
|
149
437
|
|
|
150
438
|
# Resumes updates and maintenance for an index
|
|
151
439
|
#
|
|
152
440
|
# @param [String] index_name name of the index
|
|
153
|
-
# @param [
|
|
441
|
+
# @param [Options::Search::ResumeIngest] options
|
|
154
442
|
#
|
|
155
443
|
# @return void
|
|
156
444
|
#
|
|
157
445
|
# @raise [ArgumentError]
|
|
158
446
|
# @raise [Error::IndexNotFound]
|
|
159
|
-
def resume_ingest(index_name, options =
|
|
160
|
-
@
|
|
447
|
+
def resume_ingest(index_name, options = Options::Search::ResumeIngest::DEFAULT)
|
|
448
|
+
@observability.record_operation(Observability::OP_SM_RESUME_INGEST, options.parent_span, self, :search) do |obs_handler|
|
|
449
|
+
@backend.search_index_resume_ingest(nil, nil, index_name, options.timeout, obs_handler)
|
|
450
|
+
end
|
|
161
451
|
end
|
|
162
452
|
|
|
163
453
|
# Allows querying against the index
|
|
164
454
|
#
|
|
165
455
|
# @param [String] index_name name of the index
|
|
166
|
-
# @param [
|
|
456
|
+
# @param [Options::Search::AllowQuerying] options
|
|
167
457
|
#
|
|
168
458
|
# @return void
|
|
169
459
|
#
|
|
170
460
|
# @raise [ArgumentError]
|
|
171
461
|
# @raise [Error::IndexNotFound]
|
|
172
|
-
def allow_querying(index_name, options =
|
|
173
|
-
@
|
|
462
|
+
def allow_querying(index_name, options = Options::Search::AllowQuerying::DEFAULT)
|
|
463
|
+
@observability.record_operation(Observability::OP_SM_ALLOW_QUERYING, options.parent_span, self, :search) do |obs_handler|
|
|
464
|
+
@backend.search_index_allow_querying(nil, nil, index_name, options.timeout, obs_handler)
|
|
465
|
+
end
|
|
174
466
|
end
|
|
175
467
|
|
|
176
468
|
# Disallows querying against the index
|
|
177
469
|
#
|
|
178
470
|
# @param [String] index_name name of the index
|
|
179
|
-
# @param [
|
|
471
|
+
# @param [Options::Search::DisallowQuerying] options
|
|
180
472
|
#
|
|
181
473
|
# @return void
|
|
182
474
|
#
|
|
183
475
|
# @raise [ArgumentError]
|
|
184
476
|
# @raise [Error::IndexNotFound]
|
|
185
|
-
def disallow_querying(index_name, options =
|
|
186
|
-
@
|
|
477
|
+
def disallow_querying(index_name, options = Options::Search::DisallowQuerying::DEFAULT)
|
|
478
|
+
@observability.record_operation(Observability::OP_SM_DISALLOW_QUERYING, options.parent_span, self, :search) do |obs_handler|
|
|
479
|
+
@backend.search_index_disallow_querying(nil, nil, index_name, options.timeout, obs_handler)
|
|
480
|
+
end
|
|
187
481
|
end
|
|
188
482
|
|
|
189
483
|
# Freeze the assignment of index partitions to nodes
|
|
190
484
|
#
|
|
191
485
|
# @param [String] index_name name of the index
|
|
192
|
-
# @param [
|
|
486
|
+
# @param [Options::Search::FreezePlan] options
|
|
193
487
|
#
|
|
194
488
|
# @return void
|
|
195
489
|
#
|
|
196
490
|
# @raise [ArgumentError]
|
|
197
491
|
# @raise [Error::IndexNotFound]
|
|
198
|
-
def freeze_plan(index_name, options =
|
|
199
|
-
@
|
|
492
|
+
def freeze_plan(index_name, options = Options::Search::FreezePlan::DEFAULT)
|
|
493
|
+
@observability.record_operation(Observability::OP_SM_FREEZE_PLAN, options.parent_span, self, :search) do |obs_handler|
|
|
494
|
+
@backend.search_index_freeze_plan(nil, nil, index_name, options.timeout, obs_handler)
|
|
495
|
+
end
|
|
200
496
|
end
|
|
201
497
|
|
|
202
498
|
# Unfreeze the assignment of index partitions to nodes
|
|
203
499
|
#
|
|
204
500
|
# @param [String] index_name name of the index
|
|
205
|
-
# @param [
|
|
501
|
+
# @param [Options::Search::UnfreezePlan] options
|
|
206
502
|
#
|
|
207
503
|
# @return void
|
|
208
504
|
#
|
|
209
505
|
# @raise [ArgumentError]
|
|
210
506
|
# @raise [Error::IndexNotFound]
|
|
211
|
-
def unfreeze_plan(index_name, options =
|
|
212
|
-
@
|
|
507
|
+
def unfreeze_plan(index_name, options = Options::Search::UnfreezePlan::DEFAULT)
|
|
508
|
+
@observability.record_operation(Observability::OP_SM_UNFREEZE_PLAN, options.parent_span, self, :search) do |obs_handler|
|
|
509
|
+
@backend.search_index_unfreeze_plan(nil, nil, index_name, options.timeout, obs_handler)
|
|
510
|
+
end
|
|
213
511
|
end
|
|
214
512
|
|
|
215
513
|
# Allows to see how a document is analyzed against a specific index
|
|
216
514
|
#
|
|
217
515
|
# @param [String] index_name name of the index
|
|
218
516
|
# @param [Hash] document the document to be analyzed
|
|
517
|
+
# @param [Options::Search::AnalyzeDocument] options
|
|
219
518
|
#
|
|
220
519
|
# @return [Array<Hash>]
|
|
221
520
|
#
|
|
222
521
|
# @raise [ArgumentError]
|
|
223
522
|
# @raise [Error::IndexNotFound]
|
|
224
|
-
def analyze_document(index_name, document, options =
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
class GetIndexOptions
|
|
230
|
-
# @return [Integer] the time in milliseconds allowed for the operation to complete
|
|
231
|
-
attr_accessor :timeout
|
|
232
|
-
|
|
233
|
-
# @yieldparam [GetIndexOptions] self
|
|
234
|
-
def initialize
|
|
235
|
-
yield self if block_given?
|
|
236
|
-
end
|
|
237
|
-
end
|
|
238
|
-
|
|
239
|
-
class GetAllIndexesOptions
|
|
240
|
-
# @return [Integer] the time in milliseconds allowed for the operation to complete
|
|
241
|
-
attr_accessor :timeout
|
|
242
|
-
|
|
243
|
-
# @yieldparam [GetAllIndexesOptions] self
|
|
244
|
-
def initialize
|
|
245
|
-
yield self if block_given?
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
|
|
249
|
-
class UpsertIndexOptions
|
|
250
|
-
# @return [Integer] the time in milliseconds allowed for the operation to complete
|
|
251
|
-
attr_accessor :timeout
|
|
252
|
-
|
|
253
|
-
# @yieldparam [UpsertIndexOptions] self
|
|
254
|
-
def initialize
|
|
255
|
-
yield self if block_given?
|
|
256
|
-
end
|
|
257
|
-
end
|
|
258
|
-
|
|
259
|
-
class DropIndexOptions
|
|
260
|
-
# @return [Integer] the time in milliseconds allowed for the operation to complete
|
|
261
|
-
attr_accessor :timeout
|
|
262
|
-
|
|
263
|
-
# @yieldparam [DropIndexOptions] self
|
|
264
|
-
def initialize
|
|
265
|
-
yield self if block_given?
|
|
266
|
-
end
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
class GetIndexedDocumentsCountOptions
|
|
270
|
-
# @return [Integer] the time in milliseconds allowed for the operation to complete
|
|
271
|
-
attr_accessor :timeout
|
|
272
|
-
|
|
273
|
-
# @yieldparam [GetIndexedDocumentCountOptions] self
|
|
274
|
-
def initialize
|
|
275
|
-
yield self if block_given?
|
|
276
|
-
end
|
|
277
|
-
end
|
|
278
|
-
|
|
279
|
-
class GetIndexStatsOptions
|
|
280
|
-
# @return [Integer] the time in milliseconds allowed for the operation to complete
|
|
281
|
-
attr_accessor :timeout
|
|
282
|
-
|
|
283
|
-
# @yieldparam [GetStatsOptions] self
|
|
284
|
-
def initialize
|
|
285
|
-
yield self if block_given?
|
|
523
|
+
def analyze_document(index_name, document, options = Options::Search::AnalyzeDocument::DEFAULT)
|
|
524
|
+
@observability.record_operation(Observability::OP_SM_ANALYZE_DOCUMENT, options.parent_span, self, :search) do |obs_handler|
|
|
525
|
+
res = @backend.search_index_analyze_document(nil, nil, index_name, JSON.generate(document), options.timeout, obs_handler)
|
|
526
|
+
JSON.parse(res[:analysis])
|
|
286
527
|
end
|
|
287
528
|
end
|
|
288
529
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
# @yieldparam [PauseIngestOptions] self
|
|
294
|
-
def initialize
|
|
295
|
-
yield self if block_given?
|
|
296
|
-
end
|
|
297
|
-
end
|
|
530
|
+
# @api private
|
|
531
|
+
# @deprecated use {Options::Search::GetIndex} instead
|
|
532
|
+
GetIndexOptions = Options::Search::GetIndex
|
|
298
533
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
534
|
+
# @api private
|
|
535
|
+
# @deprecated use {Options::Search::GetAllIndexes} instead
|
|
536
|
+
GetAllIndexesOptions = Options::Search::GetAllIndexes
|
|
302
537
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
end
|
|
307
|
-
end
|
|
538
|
+
# @api private
|
|
539
|
+
# @deprecated use {Options::Search::UpsertIndex} instead
|
|
540
|
+
UpsertIndexOptions = Options::Search::UpsertIndex
|
|
308
541
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
542
|
+
# @api private
|
|
543
|
+
# @deprecated use {Options::Search::DropIndex} instead
|
|
544
|
+
DropIndexOptions = Options::Search::DropIndex
|
|
312
545
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
end
|
|
317
|
-
end
|
|
546
|
+
# @api private
|
|
547
|
+
# @deprecated use {Options::Search::GetIndexedDocumentsCount} instead
|
|
548
|
+
GetIndexedDocumentsCountOptions = Options::Search::GetIndexedDocumentsCount
|
|
318
549
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
550
|
+
# @api private
|
|
551
|
+
# @deprecated use {Options::Search::GetIndexStats} instead
|
|
552
|
+
GetIndexStatsOptions = Options::Search::GetIndexStats
|
|
322
553
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
end
|
|
327
|
-
end
|
|
554
|
+
# @api private
|
|
555
|
+
# @deprecated use {Options::Search::PauseIngest} instead
|
|
556
|
+
PauseIngestOptions = Options::Search::PauseIngest
|
|
328
557
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
558
|
+
# @api private
|
|
559
|
+
# @deprecated use {Options::Search::ResumeIngest} instead
|
|
560
|
+
ResumeIngestOptions = Options::Search::ResumeIngest
|
|
332
561
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
end
|
|
337
|
-
end
|
|
562
|
+
# @api private
|
|
563
|
+
# @deprecated use {Options::Search::AllowQuerying} instead
|
|
564
|
+
AllowQueryingOptions = Options::Search::AllowQuerying
|
|
338
565
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
566
|
+
# @api private
|
|
567
|
+
# @deprecated use {Options::Search::DisallowQuerying} instead
|
|
568
|
+
DisallowQueryingOptions = Options::Search::DisallowQuerying
|
|
342
569
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
end
|
|
347
|
-
end
|
|
570
|
+
# @api private
|
|
571
|
+
# @deprecated use {Options::Search::FreezePlan} instead
|
|
572
|
+
FreezePlanOptions = Options::Search::FreezePlan
|
|
348
573
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
574
|
+
# @api private
|
|
575
|
+
# @deprecated use {Options::Search::UnfreezePlan} instead
|
|
576
|
+
UnfreezePlanOptions = Options::Search::UnfreezePlan
|
|
352
577
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
end
|
|
357
|
-
end
|
|
578
|
+
# @api private
|
|
579
|
+
# @deprecated use {Options::Search::AnalyzeDocument} instead
|
|
580
|
+
AnalyzeDocumentOptions = Options::Search::AnalyzeDocument
|
|
358
581
|
|
|
359
582
|
# @api private
|
|
360
583
|
def self.extract_search_index(resp)
|