couchbase 3.0.0.alpha.1-universal-darwin-19 → 3.0.0.beta.1-universal-darwin-19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/Gemfile +12 -2
- data/README.md +57 -2
- data/Rakefile +22 -0
- data/couchbase.gemspec +44 -11
- data/examples/analytics.rb +221 -0
- data/examples/crud.rb +1 -2
- data/examples/managing_analytics_indexes.rb +72 -0
- data/examples/managing_buckets.rb +47 -0
- data/examples/managing_collections.rb +58 -0
- data/examples/managing_query_indexes.rb +63 -0
- data/examples/managing_search_indexes.rb +62 -0
- data/examples/managing_view_indexes.rb +54 -0
- data/examples/query.rb +3 -2
- data/examples/query_with_consistency.rb +76 -0
- data/examples/search.rb +187 -0
- data/examples/search_with_consistency.rb +84 -0
- data/examples/subdocument.rb +25 -3
- data/examples/view.rb +50 -0
- data/ext/.clang-format +1 -1
- data/ext/.clang-tidy +2 -0
- data/ext/.idea/dictionaries/couchbase_terms.xml +2 -0
- data/ext/.idea/misc.xml +12 -0
- data/ext/.idea/vcs.xml +1 -0
- data/ext/CMakeLists.txt +40 -13
- data/ext/{couchbase/io/binary_message.hxx → build_config.hxx.in} +1 -19
- data/ext/build_version.hxx.in +26 -0
- data/ext/couchbase/bucket.hxx +105 -19
- data/ext/couchbase/cluster.hxx +148 -90
- data/ext/couchbase/cluster_options.hxx +53 -0
- data/ext/couchbase/collections_manifest.hxx +3 -3
- data/ext/couchbase/configuration.hxx +234 -2
- data/ext/couchbase/couchbase.cxx +4833 -476
- data/ext/couchbase/{operations/document_id.hxx → document_id.hxx} +5 -4
- data/ext/couchbase/io/dns_client.hxx +217 -0
- data/ext/couchbase/io/dns_codec.hxx +207 -0
- data/ext/couchbase/io/dns_config.hxx +116 -0
- data/ext/couchbase/io/dns_message.hxx +555 -0
- data/ext/couchbase/io/http_command.hxx +91 -0
- data/ext/couchbase/io/http_message.hxx +5 -1
- data/ext/couchbase/io/http_parser.hxx +2 -1
- data/ext/couchbase/io/http_session.hxx +120 -41
- data/ext/couchbase/io/{session_manager.hxx → http_session_manager.hxx} +43 -28
- data/ext/couchbase/io/mcbp_command.hxx +180 -0
- data/ext/couchbase/io/mcbp_message.hxx +63 -0
- data/ext/couchbase/io/mcbp_parser.hxx +101 -0
- data/ext/couchbase/io/mcbp_session.hxx +1046 -0
- data/ext/couchbase/io/streams.hxx +165 -0
- data/ext/couchbase/mutation_token.hxx +2 -1
- data/ext/couchbase/operations.hxx +70 -8
- data/ext/couchbase/operations/analytics_dataset_create.hxx +117 -0
- data/ext/couchbase/operations/analytics_dataset_drop.hxx +103 -0
- data/ext/couchbase/operations/analytics_dataset_get_all.hxx +107 -0
- data/ext/couchbase/operations/analytics_dataverse_create.hxx +104 -0
- data/ext/couchbase/operations/analytics_dataverse_drop.hxx +104 -0
- data/ext/couchbase/operations/analytics_get_pending_mutations.hxx +91 -0
- data/ext/couchbase/operations/analytics_index_create.hxx +128 -0
- data/ext/couchbase/operations/analytics_index_drop.hxx +110 -0
- data/ext/couchbase/operations/analytics_index_get_all.hxx +106 -0
- data/ext/couchbase/operations/analytics_link_connect.hxx +102 -0
- data/ext/couchbase/operations/analytics_link_disconnect.hxx +101 -0
- data/ext/couchbase/operations/bucket_create.hxx +141 -0
- data/ext/couchbase/operations/bucket_drop.hxx +68 -0
- data/ext/couchbase/operations/bucket_flush.hxx +68 -0
- data/ext/couchbase/operations/bucket_get.hxx +72 -0
- data/ext/couchbase/operations/bucket_get_all.hxx +65 -0
- data/ext/couchbase/operations/bucket_settings.hxx +111 -0
- data/ext/couchbase/operations/bucket_update.hxx +118 -0
- data/ext/couchbase/operations/cluster_developer_preview_enable.hxx +63 -0
- data/ext/couchbase/operations/collection_create.hxx +93 -0
- data/ext/couchbase/operations/collection_drop.hxx +85 -0
- data/ext/couchbase/operations/design_document.hxx +59 -0
- data/ext/couchbase/operations/document_analytics.hxx +288 -0
- data/ext/couchbase/operations/document_decrement.hxx +85 -0
- data/ext/couchbase/operations/document_exists.hxx +82 -0
- data/ext/couchbase/operations/{get.hxx → document_get.hxx} +10 -3
- data/ext/couchbase/operations/document_get_and_lock.hxx +69 -0
- data/ext/couchbase/operations/document_get_and_touch.hxx +69 -0
- data/ext/couchbase/operations/document_get_projected.hxx +247 -0
- data/ext/couchbase/operations/document_increment.hxx +87 -0
- data/ext/couchbase/operations/document_insert.hxx +79 -0
- data/ext/couchbase/operations/{lookup_in.hxx → document_lookup_in.hxx} +27 -3
- data/ext/couchbase/operations/{mutate_in.hxx → document_mutate_in.hxx} +58 -3
- data/ext/couchbase/operations/{query.hxx → document_query.hxx} +117 -12
- data/ext/couchbase/operations/{remove.hxx → document_remove.hxx} +17 -3
- data/ext/couchbase/operations/document_replace.hxx +81 -0
- data/ext/couchbase/operations/document_search.hxx +355 -0
- data/ext/couchbase/operations/document_touch.hxx +65 -0
- data/ext/couchbase/operations/{upsert.hxx → document_unlock.hxx} +17 -12
- data/ext/couchbase/operations/document_upsert.hxx +79 -0
- data/ext/couchbase/operations/document_view.hxx +228 -0
- data/ext/couchbase/operations/query_index_build_deferred.hxx +86 -0
- data/ext/couchbase/operations/query_index_create.hxx +135 -0
- data/ext/couchbase/operations/query_index_drop.hxx +109 -0
- data/ext/couchbase/operations/query_index_get_all.hxx +107 -0
- data/ext/couchbase/operations/scope_create.hxx +84 -0
- data/ext/couchbase/operations/scope_drop.hxx +82 -0
- data/ext/couchbase/operations/scope_get_all.hxx +76 -0
- data/ext/couchbase/operations/search_index.hxx +79 -0
- data/ext/couchbase/operations/search_index_analyze_document.hxx +92 -0
- data/ext/couchbase/operations/search_index_control_ingest.hxx +80 -0
- data/ext/couchbase/operations/search_index_control_plan_freeze.hxx +80 -0
- data/ext/couchbase/operations/search_index_control_query.hxx +80 -0
- data/ext/couchbase/operations/search_index_drop.hxx +77 -0
- data/ext/couchbase/operations/search_index_get.hxx +80 -0
- data/ext/couchbase/operations/search_index_get_all.hxx +82 -0
- data/ext/couchbase/operations/search_index_get_documents_count.hxx +81 -0
- data/ext/couchbase/operations/search_index_upsert.hxx +106 -0
- data/ext/couchbase/operations/view_index_drop.hxx +67 -0
- data/ext/couchbase/operations/view_index_get.hxx +90 -0
- data/ext/couchbase/operations/view_index_get_all.hxx +125 -0
- data/ext/couchbase/operations/view_index_upsert.hxx +87 -0
- data/ext/couchbase/origin.hxx +148 -0
- data/ext/couchbase/protocol/client_opcode.hxx +52 -3
- data/ext/couchbase/protocol/client_request.hxx +56 -9
- data/ext/couchbase/protocol/client_response.hxx +53 -16
- data/ext/couchbase/protocol/cmd_cluster_map_change_notification.hxx +76 -0
- data/ext/couchbase/protocol/cmd_decrement.hxx +187 -0
- data/ext/couchbase/protocol/cmd_exists.hxx +171 -0
- data/ext/couchbase/protocol/cmd_get.hxx +31 -8
- data/ext/couchbase/protocol/cmd_get_and_lock.hxx +142 -0
- data/ext/couchbase/protocol/cmd_get_and_touch.hxx +142 -0
- data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +16 -8
- data/ext/couchbase/protocol/cmd_get_collection_id.hxx +117 -0
- data/ext/couchbase/protocol/cmd_get_collections_manifest.hxx +16 -3
- data/ext/couchbase/protocol/cmd_get_error_map.hxx +16 -3
- data/ext/couchbase/protocol/cmd_hello.hxx +34 -8
- data/ext/couchbase/protocol/cmd_increment.hxx +187 -0
- data/ext/couchbase/protocol/cmd_info.hxx +1 -11
- data/ext/couchbase/protocol/cmd_insert.hxx +172 -0
- data/ext/couchbase/protocol/cmd_lookup_in.hxx +29 -13
- data/ext/couchbase/protocol/cmd_mutate_in.hxx +116 -16
- data/ext/couchbase/protocol/cmd_remove.hxx +59 -4
- data/ext/couchbase/protocol/cmd_replace.hxx +172 -0
- data/ext/couchbase/protocol/cmd_sasl_auth.hxx +15 -3
- data/ext/couchbase/protocol/cmd_sasl_list_mechs.hxx +15 -3
- data/ext/couchbase/protocol/cmd_sasl_step.hxx +15 -3
- data/ext/couchbase/protocol/cmd_select_bucket.hxx +14 -2
- data/ext/couchbase/protocol/cmd_touch.hxx +102 -0
- data/ext/couchbase/protocol/cmd_unlock.hxx +95 -0
- data/ext/couchbase/protocol/cmd_upsert.hxx +54 -18
- data/ext/couchbase/protocol/durability_level.hxx +67 -0
- data/ext/couchbase/protocol/frame_info_id.hxx +187 -0
- data/ext/couchbase/protocol/hello_feature.hxx +137 -0
- data/ext/couchbase/protocol/server_opcode.hxx +57 -0
- data/ext/couchbase/protocol/server_request.hxx +122 -0
- data/ext/couchbase/protocol/unsigned_leb128.h +15 -15
- data/ext/couchbase/service_type.hxx +38 -1
- data/ext/couchbase/timeout_defaults.hxx +41 -0
- data/ext/couchbase/utils/byteswap.hxx +1 -2
- data/ext/couchbase/utils/connection_string.hxx +370 -0
- data/ext/couchbase/utils/url_codec.hxx +225 -0
- data/ext/couchbase/version.hxx +3 -1
- data/ext/extconf.rb +46 -10
- data/ext/test/main.cxx +111 -118
- data/ext/third_party/http_parser/Makefile +160 -0
- data/ext/third_party/json/Makefile +77 -0
- data/ext/third_party/snappy/.appveyor.yml +36 -0
- data/ext/third_party/snappy/.gitignore +8 -0
- data/ext/third_party/snappy/.travis.yml +98 -0
- data/ext/third_party/snappy/AUTHORS +1 -0
- data/ext/third_party/snappy/CMakeLists.txt +345 -0
- data/ext/third_party/snappy/CONTRIBUTING.md +26 -0
- data/ext/third_party/snappy/COPYING +54 -0
- data/ext/third_party/snappy/NEWS +188 -0
- data/ext/third_party/snappy/README.md +148 -0
- data/ext/third_party/snappy/cmake/SnappyConfig.cmake.in +33 -0
- data/ext/third_party/snappy/cmake/config.h.in +59 -0
- data/ext/third_party/snappy/docs/README.md +72 -0
- data/ext/third_party/snappy/format_description.txt +110 -0
- data/ext/third_party/snappy/framing_format.txt +135 -0
- data/ext/third_party/snappy/snappy-c.cc +90 -0
- data/ext/third_party/snappy/snappy-c.h +138 -0
- data/ext/third_party/snappy/snappy-internal.h +315 -0
- data/ext/third_party/snappy/snappy-sinksource.cc +121 -0
- data/ext/third_party/snappy/snappy-sinksource.h +182 -0
- data/ext/third_party/snappy/snappy-stubs-internal.cc +42 -0
- data/ext/third_party/snappy/snappy-stubs-internal.h +493 -0
- data/ext/third_party/snappy/snappy-stubs-public.h.in +63 -0
- data/ext/third_party/snappy/snappy-test.cc +613 -0
- data/ext/third_party/snappy/snappy-test.h +526 -0
- data/ext/third_party/snappy/snappy.cc +1770 -0
- data/ext/third_party/snappy/snappy.h +209 -0
- data/ext/third_party/snappy/snappy_compress_fuzzer.cc +60 -0
- data/ext/third_party/snappy/snappy_uncompress_fuzzer.cc +58 -0
- data/ext/third_party/snappy/snappy_unittest.cc +1512 -0
- data/lib/couchbase/analytics_options.rb +179 -0
- data/lib/couchbase/binary_collection.rb +37 -76
- data/lib/couchbase/binary_collection_options.rb +98 -0
- data/lib/couchbase/bucket.rb +63 -5
- data/lib/couchbase/cluster.rb +189 -113
- data/lib/couchbase/collection.rb +153 -200
- data/lib/couchbase/collection_options.rb +496 -0
- data/{bin/console → lib/couchbase/datastructures.rb} +4 -7
- data/lib/couchbase/datastructures/couchbase_list.rb +171 -0
- data/lib/couchbase/datastructures/couchbase_map.rb +205 -0
- data/lib/couchbase/datastructures/couchbase_queue.rb +145 -0
- data/lib/couchbase/datastructures/couchbase_set.rb +138 -0
- data/lib/couchbase/errors.rb +140 -135
- data/{bin/setup → lib/couchbase/json_transcoder.rb} +17 -8
- data/lib/couchbase/libcouchbase.bundle +0 -0
- data/lib/couchbase/management/analytics_index_manager.rb +309 -19
- data/lib/couchbase/management/bucket_manager.rb +98 -33
- data/lib/couchbase/management/collection_manager.rb +175 -1
- data/lib/couchbase/management/query_index_manager.rb +271 -0
- data/lib/couchbase/management/search_index_manager.rb +338 -0
- data/lib/couchbase/management/user_manager.rb +13 -11
- data/lib/couchbase/management/view_index_manager.rb +204 -1
- data/lib/couchbase/mutation_state.rb +12 -1
- data/lib/couchbase/query_options.rb +242 -0
- data/lib/couchbase/scope.rb +3 -10
- data/lib/couchbase/search_options.rb +1499 -0
- data/lib/couchbase/subdoc.rb +80 -19
- data/lib/couchbase/version.rb +1 -1
- data/lib/couchbase/view_options.rb +156 -0
- metadata +164 -777
- data/.gitignore +0 -20
- data/.gitmodules +0 -15
- data/.idea/.gitignore +0 -5
- data/.idea/dictionaries/gem_terms.xml +0 -13
- data/.idea/inspectionProfiles/Project_Default.xml +0 -7
- data/.idea/vcs.xml +0 -11
- data/.travis.yml +0 -7
- data/ext/couchbase/configuration_monitor.hxx +0 -93
- data/ext/couchbase/io/binary_parser.hxx +0 -64
- data/ext/couchbase/io/key_value_session.hxx +0 -754
- data/ext/couchbase/operations/command.hxx +0 -77
- data/ext/third_party/asio/asio/src/examples/cpp03/Makefile.am +0 -251
- data/ext/third_party/asio/asio/src/examples/cpp03/allocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/allocation/server.cpp +0 -285
- data/ext/third_party/asio/asio/src/examples/cpp03/buffers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/buffers/reference_counted.cpp +0 -131
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/chat_client.cpp +0 -177
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/chat_message.hpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/chat_server.cpp +0 -249
- data/ext/third_party/asio/asio/src/examples/cpp03/chat/posix_chat_client.cpp +0 -204
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/async_tcp_echo_server.cpp +0 -137
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/async_udp_echo_server.cpp +0 -92
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_tcp_echo_client.cpp +0 -59
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_tcp_echo_server.cpp +0 -79
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_udp_echo_client.cpp +0 -59
- data/ext/third_party/asio/asio/src/examples/cpp03/echo/blocking_udp_echo_server.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp03/fork/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/fork/daemon.cpp +0 -190
- data/ext/third_party/asio/asio/src/examples/cpp03/fork/process_per_connection.cpp +0 -161
- data/ext/third_party/asio/asio/src/examples/cpp03/http/client/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/http/client/async_client.cpp +0 -204
- data/ext/third_party/asio/asio/src/examples/cpp03/http/client/sync_client.cpp +0 -106
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_1K.html +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_2K.html +0 -49
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_4K.html +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp03/http/doc_root/data_8K.html +0 -175
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection.cpp +0 -99
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection.hpp +0 -83
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection_manager.cpp +0 -38
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/connection_manager.hpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/main.cpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_handler.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/request_parser.hpp +0 -95
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/server.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server/server.hpp +0 -69
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/connection.cpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/connection.hpp +0 -75
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/io_context_pool.cpp +0 -69
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/io_context_pool.hpp +0 -58
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/main.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_handler.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/request_parser.hpp +0 -95
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/server.cpp +0 -77
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server2/server.hpp +0 -68
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/connection.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/connection.hpp +0 -78
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/main.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_handler.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/request_parser.hpp +0 -95
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/server.cpp +0 -89
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server3/server.hpp +0 -70
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/file_handler.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/file_handler.hpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/main.cpp +0 -58
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/mime_types.cpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/reply.cpp +0 -256
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/request.hpp +0 -46
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/request_parser.cpp +0 -226
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/request_parser.hpp +0 -78
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/server.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/http/server4/server.hpp +0 -73
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/icmp_header.hpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/ipv4_header.hpp +0 -102
- data/ext/third_party/asio/asio/src/examples/cpp03/icmp/ping.cpp +0 -163
- data/ext/third_party/asio/asio/src/examples/cpp03/invocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/invocation/prioritised_handlers.cpp +0 -171
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/daytime_client.cpp +0 -44
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/daytime_server.cpp +0 -51
- data/ext/third_party/asio/asio/src/examples/cpp03/iostreams/http_client.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp03/local/.gitignore +0 -13
- data/ext/third_party/asio/asio/src/examples/cpp03/local/connect_pair.cpp +0 -141
- data/ext/third_party/asio/asio/src/examples/cpp03/local/iostream_client.cpp +0 -62
- data/ext/third_party/asio/asio/src/examples/cpp03/local/stream_client.cpp +0 -61
- data/ext/third_party/asio/asio/src/examples/cpp03/local/stream_server.cpp +0 -141
- data/ext/third_party/asio/asio/src/examples/cpp03/multicast/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/multicast/receiver.cpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp03/multicast/sender.cpp +0 -98
- data/ext/third_party/asio/asio/src/examples/cpp03/nonblocking/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/nonblocking/third_party_lib.cpp +0 -240
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/client.cpp +0 -192
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/protocol.hpp +0 -156
- data/ext/third_party/asio/asio/src/examples/cpp03/porthopper/server.cpp +0 -187
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/client.cpp +0 -125
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/connection.hpp +0 -188
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/server.cpp +0 -123
- data/ext/third_party/asio/asio/src/examples/cpp03/serialization/stock.hpp +0 -50
- data/ext/third_party/asio/asio/src/examples/cpp03/services/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/services/basic_logger.hpp +0 -83
- data/ext/third_party/asio/asio/src/examples/cpp03/services/daytime_client.cpp +0 -97
- data/ext/third_party/asio/asio/src/examples/cpp03/services/logger.hpp +0 -24
- data/ext/third_party/asio/asio/src/examples/cpp03/services/logger_service.cpp +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/services/logger_service.hpp +0 -145
- data/ext/third_party/asio/asio/src/examples/cpp03/socks4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/socks4/socks4.hpp +0 -144
- data/ext/third_party/asio/asio/src/examples/cpp03/socks4/sync_client.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp03/spawn/.gitignore +0 -12
- data/ext/third_party/asio/asio/src/examples/cpp03/spawn/echo_server.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp03/spawn/parallel_grep.cpp +0 -89
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/README +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/ca.pem +0 -49
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/client.cpp +0 -157
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/dh2048.pem +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/server.cpp +0 -170
- data/ext/third_party/asio/asio/src/examples/cpp03/ssl/server.pem +0 -71
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/async_tcp_client.cpp +0 -311
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/blocking_tcp_client.cpp +0 -191
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/blocking_token_tcp_client.cpp +0 -200
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/blocking_udp_client.cpp +0 -154
- data/ext/third_party/asio/asio/src/examples/cpp03/timeouts/server.cpp +0 -433
- data/ext/third_party/asio/asio/src/examples/cpp03/timers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/timers/time_t_timer.cpp +0 -106
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime1/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime1/client.cpp +0 -57
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime2/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime2/server.cpp +0 -50
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime3/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime3/server.cpp +0 -119
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime4/client.cpp +0 -52
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime5/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime5/server.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime6/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime6/server.cpp +0 -89
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime7/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime7/server.cpp +0 -160
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/daytime_dox.txt +0 -500
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/index_dox.txt +0 -48
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer1/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer1/timer.cpp +0 -24
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer2/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer2/timer.cpp +0 -29
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer3/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer3/timer.cpp +0 -43
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer4/timer.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer5/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer5/timer.cpp +0 -80
- data/ext/third_party/asio/asio/src/examples/cpp03/tutorial/timer_dox.txt +0 -378
- data/ext/third_party/asio/asio/src/examples/cpp03/windows/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp03/windows/transmit_file.cpp +0 -177
- data/ext/third_party/asio/asio/src/examples/cpp11/Makefile.am +0 -161
- data/ext/third_party/asio/asio/src/examples/cpp11/allocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/allocation/server.cpp +0 -255
- data/ext/third_party/asio/asio/src/examples/cpp11/buffers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/buffers/reference_counted.cpp +0 -122
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/chat_client.cpp +0 -167
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/chat_message.hpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp11/chat/chat_server.cpp +0 -227
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp +0 -114
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/async_udp_echo_server.cpp +0 -82
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_tcp_echo_client.cpp +0 -55
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_tcp_echo_server.cpp +0 -74
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_udp_echo_client.cpp +0 -58
- data/ext/third_party/asio/asio/src/examples/cpp11/echo/blocking_udp_echo_server.cpp +0 -52
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/.gitignore +0 -5
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/actor.cpp +0 -286
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/bank_account_1.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/bank_account_2.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/fork_join.cpp +0 -328
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/pipeline.cpp +0 -299
- data/ext/third_party/asio/asio/src/examples/cpp11/executors/priority_scheduler.cpp +0 -174
- data/ext/third_party/asio/asio/src/examples/cpp11/fork/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/fork/daemon.cpp +0 -189
- data/ext/third_party/asio/asio/src/examples/cpp11/fork/process_per_connection.cpp +0 -162
- data/ext/third_party/asio/asio/src/examples/cpp11/futures/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/futures/daytime_client.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp11/handler_tracking/custom_tracking.hpp +0 -201
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection.hpp +0 -79
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.cpp +0 -40
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/connection_manager.hpp +0 -48
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/header.hpp +0 -28
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/main.cpp +0 -43
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/mime_types.cpp +0 -45
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/mime_types.hpp +0 -27
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/reply.cpp +0 -255
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/reply.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request.hpp +0 -34
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_handler.cpp +0 -121
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_handler.hpp +0 -47
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_parser.cpp +0 -315
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/request_parser.hpp +0 -96
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/server.cpp +0 -94
- data/ext/third_party/asio/asio/src/examples/cpp11/http/server/server.hpp +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp11/invocation/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/invocation/prioritised_handlers.cpp +0 -202
- data/ext/third_party/asio/asio/src/examples/cpp11/iostreams/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/iostreams/http_client.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp11/local/.gitignore +0 -13
- data/ext/third_party/asio/asio/src/examples/cpp11/local/connect_pair.cpp +0 -129
- data/ext/third_party/asio/asio/src/examples/cpp11/local/iostream_client.cpp +0 -61
- data/ext/third_party/asio/asio/src/examples/cpp11/local/stream_client.cpp +0 -60
- data/ext/third_party/asio/asio/src/examples/cpp11/local/stream_server.cpp +0 -121
- data/ext/third_party/asio/asio/src/examples/cpp11/multicast/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/multicast/receiver.cpp +0 -88
- data/ext/third_party/asio/asio/src/examples/cpp11/multicast/sender.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp11/nonblocking/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/nonblocking/third_party_lib.cpp +0 -212
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_1.cpp +0 -113
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_2.cpp +0 -131
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_3.cpp +0 -192
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_4.cpp +0 -207
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_5.cpp +0 -243
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_6.cpp +0 -302
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_7.cpp +0 -222
- data/ext/third_party/asio/asio/src/examples/cpp11/operations/composed_8.cpp +0 -217
- data/ext/third_party/asio/asio/src/examples/cpp11/socks4/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/socks4/socks4.hpp +0 -143
- data/ext/third_party/asio/asio/src/examples/cpp11/socks4/sync_client.cpp +0 -93
- data/ext/third_party/asio/asio/src/examples/cpp11/spawn/.gitignore +0 -12
- data/ext/third_party/asio/asio/src/examples/cpp11/spawn/echo_server.cpp +0 -111
- data/ext/third_party/asio/asio/src/examples/cpp11/spawn/parallel_grep.cpp +0 -84
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/README +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/ca.pem +0 -49
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/client.cpp +0 -165
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/dh2048.pem +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/server.cpp +0 -143
- data/ext/third_party/asio/asio/src/examples/cpp11/ssl/server.pem +0 -71
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/async_tcp_client.cpp +0 -311
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/blocking_tcp_client.cpp +0 -192
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp +0 -197
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/blocking_udp_client.cpp +0 -155
- data/ext/third_party/asio/asio/src/examples/cpp11/timeouts/server.cpp +0 -433
- data/ext/third_party/asio/asio/src/examples/cpp11/timers/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp11/timers/time_t_timer.cpp +0 -106
- data/ext/third_party/asio/asio/src/examples/cpp14/Makefile.am +0 -64
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/async_tcp_echo_server.cpp +0 -117
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/async_udp_echo_server.cpp +0 -83
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_tcp_echo_client.cpp +0 -55
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_tcp_echo_server.cpp +0 -77
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_udp_echo_client.cpp +0 -59
- data/ext/third_party/asio/asio/src/examples/cpp14/echo/blocking_udp_echo_server.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/.gitignore +0 -6
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/actor.cpp +0 -281
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/async_1.cpp +0 -47
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/async_2.cpp +0 -68
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/bank_account_1.cpp +0 -54
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/bank_account_2.cpp +0 -53
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/fork_join.cpp +0 -327
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/pipeline.cpp +0 -294
- data/ext/third_party/asio/asio/src/examples/cpp14/executors/priority_scheduler.cpp +0 -173
- data/ext/third_party/asio/asio/src/examples/cpp14/iostreams/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/examples/cpp14/iostreams/http_client.cpp +0 -91
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/.gitignore +0 -10
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_1.cpp +0 -113
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_2.cpp +0 -131
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_3.cpp +0 -186
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_4.cpp +0 -201
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_5.cpp +0 -238
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_6.cpp +0 -298
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_7.cpp +0 -219
- data/ext/third_party/asio/asio/src/examples/cpp14/operations/composed_8.cpp +0 -212
- data/ext/third_party/asio/asio/src/examples/cpp17/Makefile.am +0 -8
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/chat_server.cpp +0 -225
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/echo_server.cpp +0 -76
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/echo_server_with_default.cpp +0 -78
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/range_based_for.cpp +0 -107
- data/ext/third_party/asio/asio/src/examples/cpp17/coroutines_ts/refactored_echo_server.cpp +0 -85
- data/ext/third_party/asio/asio/src/tests/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/tests/Makefile.am +0 -432
- data/ext/third_party/asio/asio/src/tests/latency/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/tests/latency/allocator.hpp +0 -52
- data/ext/third_party/asio/asio/src/tests/latency/high_res_clock.hpp +0 -53
- data/ext/third_party/asio/asio/src/tests/latency/tcp_client.cpp +0 -124
- data/ext/third_party/asio/asio/src/tests/latency/tcp_server.cpp +0 -114
- data/ext/third_party/asio/asio/src/tests/latency/udp_client.cpp +0 -104
- data/ext/third_party/asio/asio/src/tests/latency/udp_server.cpp +0 -125
- data/ext/third_party/asio/asio/src/tests/performance/.gitignore +0 -11
- data/ext/third_party/asio/asio/src/tests/performance/client.cpp +0 -286
- data/ext/third_party/asio/asio/src/tests/performance/handler_allocator.hpp +0 -112
- data/ext/third_party/asio/asio/src/tests/performance/server.cpp +0 -233
- data/ext/third_party/asio/asio/src/tests/unit/.gitignore +0 -75
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/async_ops.hpp +0 -415
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/async_result.hpp +0 -94
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/gettable_socket_option.hpp +0 -54
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/io_control_command.hpp +0 -32
- data/ext/third_party/asio/asio/src/tests/unit/archetypes/settable_socket_option.hpp +0 -49
- data/ext/third_party/asio/asio/src/tests/unit/associated_allocator.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/associated_executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/async_result.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/awaitable.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_datagram_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_deadline_timer.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_raw_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_seq_packet_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_serial_port.cpp +0 -26
- data/ext/third_party/asio/asio/src/tests/unit/basic_signal_set.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_socket_acceptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_stream_socket.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_streambuf.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/basic_waitable_timer.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/bind_executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/buffer.cpp +0 -830
- data/ext/third_party/asio/asio/src/tests/unit/buffered_read_stream.cpp +0 -338
- data/ext/third_party/asio/asio/src/tests/unit/buffered_stream.cpp +0 -364
- data/ext/third_party/asio/asio/src/tests/unit/buffered_write_stream.cpp +0 -353
- data/ext/third_party/asio/asio/src/tests/unit/buffers_iterator.cpp +0 -292
- data/ext/third_party/asio/asio/src/tests/unit/co_spawn.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/completion_condition.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/compose.cpp +0 -185
- data/ext/third_party/asio/asio/src/tests/unit/connect.cpp +0 -1190
- data/ext/third_party/asio/asio/src/tests/unit/coroutine.cpp +0 -112
- data/ext/third_party/asio/asio/src/tests/unit/deadline_timer.cpp +0 -392
- data/ext/third_party/asio/asio/src/tests/unit/defer.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/detached.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/dispatch.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/error.cpp +0 -89
- data/ext/third_party/asio/asio/src/tests/unit/execution_context.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/executor_work_guard.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/generic/.gitignore +0 -14
- data/ext/third_party/asio/asio/src/tests/unit/generic/basic_endpoint.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/generic/datagram_protocol.cpp +0 -263
- data/ext/third_party/asio/asio/src/tests/unit/generic/raw_protocol.cpp +0 -263
- data/ext/third_party/asio/asio/src/tests/unit/generic/seq_packet_protocol.cpp +0 -205
- data/ext/third_party/asio/asio/src/tests/unit/generic/stream_protocol.cpp +0 -248
- data/ext/third_party/asio/asio/src/tests/unit/high_resolution_timer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/io_context.cpp +0 -362
- data/ext/third_party/asio/asio/src/tests/unit/io_context_strand.cpp +0 -325
- data/ext/third_party/asio/asio/src/tests/unit/ip/.gitignore +0 -27
- data/ext/third_party/asio/asio/src/tests/unit/ip/address.cpp +0 -144
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_endpoint.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver_entry.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver_iterator.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/basic_resolver_query.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/host_name.cpp +0 -55
- data/ext/third_party/asio/asio/src/tests/unit/ip/icmp.cpp +0 -577
- data/ext/third_party/asio/asio/src/tests/unit/ip/multicast.cpp +0 -363
- data/ext/third_party/asio/asio/src/tests/unit/ip/network_v4.cpp +0 -314
- data/ext/third_party/asio/asio/src/tests/unit/ip/network_v6.cpp +0 -238
- data/ext/third_party/asio/asio/src/tests/unit/ip/resolver_query_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ip/tcp.cpp +0 -1346
- data/ext/third_party/asio/asio/src/tests/unit/ip/udp.cpp +0 -673
- data/ext/third_party/asio/asio/src/tests/unit/ip/unicast.cpp +0 -171
- data/ext/third_party/asio/asio/src/tests/unit/ip/v6_only.cpp +0 -135
- data/ext/third_party/asio/asio/src/tests/unit/is_read_buffered.cpp +0 -129
- data/ext/third_party/asio/asio/src/tests/unit/is_write_buffered.cpp +0 -129
- data/ext/third_party/asio/asio/src/tests/unit/local/.gitignore +0 -13
- data/ext/third_party/asio/asio/src/tests/unit/local/basic_endpoint.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/local/connect_pair.cpp +0 -76
- data/ext/third_party/asio/asio/src/tests/unit/local/datagram_protocol.cpp +0 -242
- data/ext/third_party/asio/asio/src/tests/unit/local/stream_protocol.cpp +0 -219
- data/ext/third_party/asio/asio/src/tests/unit/packaged_task.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/placeholders.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/.gitignore +0 -14
- data/ext/third_party/asio/asio/src/tests/unit/posix/basic_descriptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/basic_stream_descriptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/descriptor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/descriptor_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/posix/stream_descriptor.cpp +0 -183
- data/ext/third_party/asio/asio/src/tests/unit/post.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/read.cpp +0 -4997
- data/ext/third_party/asio/asio/src/tests/unit/read_at.cpp +0 -7502
- data/ext/third_party/asio/asio/src/tests/unit/read_until.cpp +0 -1658
- data/ext/third_party/asio/asio/src/tests/unit/redirect_error.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/serial_port.cpp +0 -173
- data/ext/third_party/asio/asio/src/tests/unit/serial_port_base.cpp +0 -99
- data/ext/third_party/asio/asio/src/tests/unit/signal_set.cpp +0 -95
- data/ext/third_party/asio/asio/src/tests/unit/socket_base.cpp +0 -650
- data/ext/third_party/asio/asio/src/tests/unit/ssl/.gitignore +0 -15
- data/ext/third_party/asio/asio/src/tests/unit/ssl/context.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/context_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/error.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/host_name_verification.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/rfc2818_verification.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ssl/stream.cpp +0 -191
- data/ext/third_party/asio/asio/src/tests/unit/ssl/stream_base.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/steady_timer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/strand.cpp +0 -263
- data/ext/third_party/asio/asio/src/tests/unit/streambuf.cpp +0 -62
- data/ext/third_party/asio/asio/src/tests/unit/system_context.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/system_executor.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/system_timer.cpp +0 -399
- data/ext/third_party/asio/asio/src/tests/unit/this_coro.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/thread.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/time_traits.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/ts/.gitignore +0 -17
- data/ext/third_party/asio/asio/src/tests/unit/ts/buffer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/executor.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/internet.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/io_context.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/net.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/netfwd.cpp +0 -33
- data/ext/third_party/asio/asio/src/tests/unit/ts/socket.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/ts/timer.cpp +0 -30
- data/ext/third_party/asio/asio/src/tests/unit/unit_test.hpp +0 -175
- data/ext/third_party/asio/asio/src/tests/unit/use_awaitable.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/use_future.cpp +0 -670
- data/ext/third_party/asio/asio/src/tests/unit/uses_executor.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/wait_traits.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/.gitignore +0 -18
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_object_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_overlapped_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_random_access_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/basic_stream_handle.cpp +0 -25
- data/ext/third_party/asio/asio/src/tests/unit/windows/object_handle.cpp +0 -130
- data/ext/third_party/asio/asio/src/tests/unit/windows/overlapped_handle.cpp +0 -26
- data/ext/third_party/asio/asio/src/tests/unit/windows/overlapped_ptr.cpp +0 -107
- data/ext/third_party/asio/asio/src/tests/unit/windows/random_access_handle.cpp +0 -155
- data/ext/third_party/asio/asio/src/tests/unit/windows/stream_handle.cpp +0 -148
- data/ext/third_party/asio/asio/src/tests/unit/write.cpp +0 -4904
- data/ext/third_party/asio/asio/src/tests/unit/write_at.cpp +0 -7563
- data/ext/third_party/asio/asio/src/tools/handlerviz.pl +0 -299
- data/ext/third_party/gsl/tests/CMakeLists.txt +0 -267
- data/ext/third_party/gsl/tests/CMakeLists.txt.in +0 -14
- data/ext/third_party/gsl/tests/algorithm_tests.cpp +0 -227
- data/ext/third_party/gsl/tests/assertion_tests.cpp +0 -61
- data/ext/third_party/gsl/tests/at_tests.cpp +0 -135
- data/ext/third_party/gsl/tests/bounds_tests.cpp +0 -102
- data/ext/third_party/gsl/tests/byte_tests.cpp +0 -129
- data/ext/third_party/gsl/tests/multi_span_tests.cpp +0 -1866
- data/ext/third_party/gsl/tests/no_exception_ensure_tests.cpp +0 -48
- data/ext/third_party/gsl/tests/notnull_tests.cpp +0 -535
- data/ext/third_party/gsl/tests/owner_tests.cpp +0 -43
- data/ext/third_party/gsl/tests/span_compatibility_tests.cpp +0 -1021
- data/ext/third_party/gsl/tests/span_ext_tests.cpp +0 -360
- data/ext/third_party/gsl/tests/span_tests.cpp +0 -1244
- data/ext/third_party/gsl/tests/strict_notnull_tests.cpp +0 -190
- data/ext/third_party/gsl/tests/strided_span_tests.cpp +0 -790
- data/ext/third_party/gsl/tests/string_span_tests.cpp +0 -1217
- data/ext/third_party/gsl/tests/utils_tests.cpp +0 -129
- data/ext/third_party/http_parser/contrib/parsertrace.c +0 -157
- data/ext/third_party/http_parser/contrib/url_parser.c +0 -47
- data/ext/third_party/http_parser/fuzzers/fuzz_parser.c +0 -26
- data/ext/third_party/http_parser/fuzzers/fuzz_url.c +0 -14
- data/ext/third_party/json/contrib/nlohmann.cpp +0 -48
- data/ext/third_party/json/contrib/nlohmann/from_value.hpp +0 -62
- data/ext/third_party/json/contrib/nlohmann/json.hpp +0 -18928
- data/ext/third_party/json/contrib/nlohmann/to_value.hpp +0 -109
- data/ext/third_party/json/doc/Advanced-Use-Cases.md +0 -83
- data/ext/third_party/json/doc/Batteries-Included.md +0 -212
- data/ext/third_party/json/doc/Binding-Traits.md +0 -319
- data/ext/third_party/json/doc/Changelog.md +0 -31
- data/ext/third_party/json/doc/Common-Use-Cases.md +0 -148
- data/ext/third_party/json/doc/Design-Decisions.md +0 -36
- data/ext/third_party/json/doc/Events-Interface.md +0 -140
- data/ext/third_party/json/doc/Getting-Started.md +0 -19
- data/ext/third_party/json/doc/Instance-Sharing.md +0 -163
- data/ext/third_party/json/doc/Interoperability.md +0 -75
- data/ext/third_party/json/doc/Overview.md +0 -24
- data/ext/third_party/json/doc/Overview.png +0 -0
- data/ext/third_party/json/doc/Parser-Interface.md +0 -84
- data/ext/third_party/json/doc/README.md +0 -78
- data/ext/third_party/json/doc/Scratchpad.md +0 -25
- data/ext/third_party/json/doc/Type-Traits.md +0 -364
- data/ext/third_party/json/doc/Types.png +0 -0
- data/ext/third_party/json/doc/Value-Class.md +0 -525
- data/ext/third_party/json/src/example/json/CMakeLists.txt +0 -67
- data/ext/third_party/json/src/example/json/cbor_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/cbor_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_cplusplus.cpp +0 -249
- data/ext/third_party/json/src/example/json/jaxn_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/jaxn_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/json_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/msgpack_to_ubjson.cpp +0 -18
- data/ext/third_party/json/src/example/json/printf_doubles.cpp +0 -51
- data/ext/third_party/json/src/example/json/ubjson_to_cbor.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_msgpack.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_pretty_jaxn.cpp +0 -18
- data/ext/third_party/json/src/example/json/ubjson_to_pretty_json.cpp +0 -18
- data/ext/third_party/json/src/example/json/validate_event_order.cpp +0 -27
- data/ext/third_party/json/src/example/json/validate_integer.cpp +0 -56
- data/ext/third_party/json/src/perf/json/bench_mark.hpp +0 -43
- data/ext/third_party/json/src/perf/json/benchmark.cpp +0 -34
- data/ext/third_party/json/src/perf/json/parse_file.cpp +0 -17
- data/ext/third_party/json/src/perf/json/pretty_print_file.cpp +0 -19
- data/ext/third_party/json/src/perf/json/print_double.cpp +0 -34
- data/ext/third_party/json/src/perf/json/print_file.cpp +0 -19
- data/ext/third_party/json/src/perf/json/sizes.cpp +0 -24
- data/ext/third_party/json/src/perf/json/syntax_only.cpp +0 -27
- data/ext/third_party/json/src/test/json/CMakeLists.txt +0 -97
- data/ext/third_party/json/src/test/json/big_list_of_naughty_strings.cpp +0 -43
- data/ext/third_party/json/src/test/json/binding_array.cpp +0 -549
- data/ext/third_party/json/src/test/json/binding_factory.cpp +0 -265
- data/ext/third_party/json/src/test/json/binding_object.cpp +0 -208
- data/ext/third_party/json/src/test/json/binding_versions.cpp +0 -95
- data/ext/third_party/json/src/test/json/cbor.cpp +0 -149
- data/ext/third_party/json/src/test/json/cbor_parts_parser.cpp +0 -36
- data/ext/third_party/json/src/test/json/contrib_diff.cpp +0 -43
- data/ext/third_party/json/src/test/json/contrib_get.cpp +0 -42
- data/ext/third_party/json/src/test/json/contrib_patch_add.cpp +0 -75
- data/ext/third_party/json/src/test/json/contrib_patch_copy.cpp +0 -113
- data/ext/third_party/json/src/test/json/contrib_patch_move.cpp +0 -97
- data/ext/third_party/json/src/test/json/contrib_patch_remove.cpp +0 -85
- data/ext/third_party/json/src/test/json/contrib_patch_replace.cpp +0 -79
- data/ext/third_party/json/src/test/json/contrib_patch_test.cpp +0 -69
- data/ext/third_party/json/src/test/json/contrib_position.cpp +0 -48
- data/ext/third_party/json/src/test/json/contrib_reference.cpp +0 -44
- data/ext/third_party/json/src/test/json/contrib_schema.cpp +0 -132
- data/ext/third_party/json/src/test/json/contrib_traits.cpp +0 -258
- data/ext/third_party/json/src/test/json/double.cpp +0 -182
- data/ext/third_party/json/src/test/json/enable_implicit_constructor.cpp +0 -54
- data/ext/third_party/json/src/test/json/escape.cpp +0 -42
- data/ext/third_party/json/src/test/json/events_binary_to.cpp +0 -56
- data/ext/third_party/json/src/test/json/events_compare.cpp +0 -433
- data/ext/third_party/json/src/test/json/events_debug.cpp +0 -24
- data/ext/third_party/json/src/test/json/events_hash.cpp +0 -65
- data/ext/third_party/json/src/test/json/events_to_stream.cpp +0 -28
- data/ext/third_party/json/src/test/json/events_to_string.cpp +0 -25
- data/ext/third_party/json/src/test/json/include_json.cpp +0 -14
- data/ext/third_party/json/src/test/json/integer.cpp +0 -118
- data/ext/third_party/json/src/test/json/jaxn_ostream.cpp +0 -76
- data/ext/third_party/json/src/test/json/jaxn_parse.cpp +0 -239
- data/ext/third_party/json/src/test/json/jaxn_parts_parser.cpp +0 -220
- data/ext/third_party/json/src/test/json/json_ostream.cpp +0 -102
- data/ext/third_party/json/src/test/json/json_parse.cpp +0 -153
- data/ext/third_party/json/src/test/json/json_parts_parser.cpp +0 -124
- data/ext/third_party/json/src/test/json/json_pointer.cpp +0 -176
- data/ext/third_party/json/src/test/json/key_camel_case_to_snake_case.cpp +0 -38
- data/ext/third_party/json/src/test/json/key_snake_case_to_camel_case.cpp +0 -33
- data/ext/third_party/json/src/test/json/literal.cpp +0 -18
- data/ext/third_party/json/src/test/json/main.hpp +0 -20
- data/ext/third_party/json/src/test/json/make_events.hpp +0 -362
- data/ext/third_party/json/src/test/json/msgpack.cpp +0 -136
- data/ext/third_party/json/src/test/json/object_construction.cpp +0 -167
- data/ext/third_party/json/src/test/json/opaque_pointer.cpp +0 -192
- data/ext/third_party/json/src/test/json/operators.cpp +0 -494
- data/ext/third_party/json/src/test/json/optional.cpp +0 -79
- data/ext/third_party/json/src/test/json/public_base.cpp +0 -142
- data/ext/third_party/json/src/test/json/self_contained.cpp +0 -106
- data/ext/third_party/json/src/test/json/sha256.cpp +0 -38
- data/ext/third_party/json/src/test/json/string_view.cpp +0 -70
- data/ext/third_party/json/src/test/json/temporary_parsing.cpp +0 -339
- data/ext/third_party/json/src/test/json/test.hpp +0 -74
- data/ext/third_party/json/src/test/json/test_events.hpp +0 -250
- data/ext/third_party/json/src/test/json/test_types.hpp +0 -557
- data/ext/third_party/json/src/test/json/test_unhex.hpp +0 -42
- data/ext/third_party/json/src/test/json/type.cpp +0 -35
- data/ext/third_party/json/src/test/json/ubjson.cpp +0 -119
- data/ext/third_party/json/src/test/json/uri_fragment.cpp +0 -52
- data/ext/third_party/json/src/test/json/validate_event_interfaces.cpp +0 -177
- data/ext/third_party/json/src/test/json/validate_utf8.cpp +0 -37
- data/ext/third_party/json/src/test/json/value_access.cpp +0 -144
- data/ext/third_party/json/src/test/json/value_basics.cpp +0 -241
- data/ext/third_party/json/src/test/json/value_create.cpp +0 -372
- data/ext/third_party/json/src/test/json/value_ptr.cpp +0 -33
- data/ext/third_party/json/src/test/json/value_subscript.cpp +0 -89
- data/ext/third_party/json/src/test/json/with_arguments.cpp +0 -98
- data/ext/third_party/json/tests/blns.json +0 -496
- data/ext/third_party/json/tests/canada.json +0 -9
- data/ext/third_party/json/tests/citm_catalog.json +0 -50469
- data/ext/third_party/json/tests/draft4/additionalItems.json +0 -82
- data/ext/third_party/json/tests/draft4/additionalProperties.json +0 -88
- data/ext/third_party/json/tests/draft4/allOf.json +0 -112
- data/ext/third_party/json/tests/draft4/anyOf.json +0 -68
- data/ext/third_party/json/tests/draft4/default.json +0 -49
- data/ext/third_party/json/tests/draft4/definitions.json +0 -32
- data/ext/third_party/json/tests/draft4/dependencies.json +0 -113
- data/ext/third_party/json/tests/draft4/enum.json +0 -72
- data/ext/third_party/json/tests/draft4/items.json +0 -46
- data/ext/third_party/json/tests/draft4/maxItems.json +0 -28
- data/ext/third_party/json/tests/draft4/maxLength.json +0 -33
- data/ext/third_party/json/tests/draft4/maxProperties.json +0 -28
- data/ext/third_party/json/tests/draft4/maximum.json +0 -42
- data/ext/third_party/json/tests/draft4/minItems.json +0 -28
- data/ext/third_party/json/tests/draft4/minLength.json +0 -33
- data/ext/third_party/json/tests/draft4/minProperties.json +0 -28
- data/ext/third_party/json/tests/draft4/minimum.json +0 -42
- data/ext/third_party/json/tests/draft4/multipleOf.json +0 -60
- data/ext/third_party/json/tests/draft4/not.json +0 -96
- data/ext/third_party/json/tests/draft4/oneOf.json +0 -68
- data/ext/third_party/json/tests/draft4/optional/bignum.json +0 -107
- data/ext/third_party/json/tests/draft4/optional/format.json +0 -148
- data/ext/third_party/json/tests/draft4/optional/zeroTerminatedFloats.json +0 -15
- data/ext/third_party/json/tests/draft4/pattern.json +0 -34
- data/ext/third_party/json/tests/draft4/patternProperties.json +0 -110
- data/ext/third_party/json/tests/draft4/properties.json +0 -92
- data/ext/third_party/json/tests/draft4/ref.json +0 -179
- data/ext/third_party/json/tests/draft4/refRemote.json +0 -74
- data/ext/third_party/json/tests/draft4/required.json +0 -44
- data/ext/third_party/json/tests/draft4/type.json +0 -345
- data/ext/third_party/json/tests/draft4/uniqueItems.json +0 -79
- data/ext/third_party/json/tests/taocpp/binary.jaxn +0 -4
- data/ext/third_party/json/tests/taocpp/dateTime.json +0 -108
- data/ext/third_party/json/tests/taocpp/make_events.cbor +0 -0
- data/ext/third_party/json/tests/taocpp/number.json +0 -682
- data/ext/third_party/json/tests/taocpp/position.json +0 -8
- data/ext/third_party/json/tests/taocpp/schema.json +0 -378
- data/ext/third_party/json/tests/twitter.json +0 -15482
- data/ext/third_party/spdlog/bench/CMakeLists.txt +0 -25
- data/ext/third_party/spdlog/bench/async_bench.cpp +0 -179
- data/ext/third_party/spdlog/bench/bench.cpp +0 -238
- data/ext/third_party/spdlog/bench/formatter-bench.cpp +0 -80
- data/ext/third_party/spdlog/bench/latency.cpp +0 -166
- data/ext/third_party/spdlog/bench/utils.h +0 -34
- data/ext/third_party/spdlog/example/CMakeLists.txt +0 -23
- data/ext/third_party/spdlog/example/example.cpp +0 -282
- data/ext/third_party/spdlog/logos/jetbrains-variant-4.svg +0 -43
- data/ext/third_party/spdlog/scripts/extract_version.py +0 -17
- data/ext/third_party/spdlog/scripts/format.sh +0 -16
- data/ext/third_party/spdlog/tests/CMakeLists.txt +0 -70
- data/ext/third_party/spdlog/tests/catch.hpp +0 -15372
- data/ext/third_party/spdlog/tests/catch.license +0 -23
- data/ext/third_party/spdlog/tests/includes.h +0 -26
- data/ext/third_party/spdlog/tests/main.cpp +0 -2
- data/ext/third_party/spdlog/tests/test_async.cpp +0 -188
- data/ext/third_party/spdlog/tests/test_backtrace.cpp +0 -65
- data/ext/third_party/spdlog/tests/test_cfg.cpp +0 -93
- data/ext/third_party/spdlog/tests/test_create_dir.cpp +0 -80
- data/ext/third_party/spdlog/tests/test_daily_logger.cpp +0 -149
- data/ext/third_party/spdlog/tests/test_dup_filter.cpp +0 -88
- data/ext/third_party/spdlog/tests/test_errors.cpp +0 -118
- data/ext/third_party/spdlog/tests/test_eventlog.cpp +0 -71
- data/ext/third_party/spdlog/tests/test_file_helper.cpp +0 -102
- data/ext/third_party/spdlog/tests/test_file_logging.cpp +0 -98
- data/ext/third_party/spdlog/tests/test_fmt_helper.cpp +0 -86
- data/ext/third_party/spdlog/tests/test_macros.cpp +0 -60
- data/ext/third_party/spdlog/tests/test_misc.cpp +0 -271
- data/ext/third_party/spdlog/tests/test_mpmc_q.cpp +0 -106
- data/ext/third_party/spdlog/tests/test_pattern_formatter.cpp +0 -443
- data/ext/third_party/spdlog/tests/test_registry.cpp +0 -116
- data/ext/third_party/spdlog/tests/test_sink.h +0 -79
- data/ext/third_party/spdlog/tests/test_stdout_api.cpp +0 -98
- data/ext/third_party/spdlog/tests/test_systemd.cpp +0 -15
- data/ext/third_party/spdlog/tests/test_time_point.cpp +0 -36
- data/ext/third_party/spdlog/tests/utils.cpp +0 -125
- data/ext/third_party/spdlog/tests/utils.h +0 -18
- data/lib/couchbase/results.rb +0 -307
- data/rbi/couchbase.rbi +0 -79
@@ -22,13 +22,24 @@ module Couchbase
|
|
22
22
|
attr_accessor :sequence_number
|
23
23
|
# @return [String] name of the bucket
|
24
24
|
attr_accessor :bucket_name
|
25
|
+
|
26
|
+
# @yieldparam [MutationToken] self
|
27
|
+
def initialize
|
28
|
+
yield self if block_given?
|
29
|
+
end
|
25
30
|
end
|
26
31
|
|
27
32
|
class MutationState
|
33
|
+
# @return [Array<MutationToken>]
|
34
|
+
attr_accessor :tokens
|
35
|
+
|
28
36
|
# Create a mutation state from one or more MutationTokens
|
29
37
|
#
|
30
38
|
# @param [Array<MutationToken>] mutation_tokens the mutation tokens
|
31
|
-
def initialize(*mutation_tokens)
|
39
|
+
def initialize(*mutation_tokens)
|
40
|
+
@tokens = []
|
41
|
+
add(*mutation_tokens)
|
42
|
+
end
|
32
43
|
|
33
44
|
# Add one or more Mutation tokens to this state
|
34
45
|
#
|
@@ -0,0 +1,242 @@
|
|
1
|
+
# Copyright 2020 Couchbase, Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'json'
|
16
|
+
|
17
|
+
module Couchbase
|
18
|
+
class Cluster
|
19
|
+
|
20
|
+
class QueryOptions
|
21
|
+
# @return [Integer] Timeout in milliseconds
|
22
|
+
attr_accessor :timeout
|
23
|
+
|
24
|
+
# @return [Boolean] Allows turning this request into a prepared statement query
|
25
|
+
attr_accessor :adhoc
|
26
|
+
|
27
|
+
# @return [String] Provides a custom client context ID for this query
|
28
|
+
attr_accessor :client_context_id
|
29
|
+
|
30
|
+
# @return [Integer] Allows overriding the default maximum parallelism for the query execution on the server side.
|
31
|
+
attr_accessor :max_parallelism
|
32
|
+
|
33
|
+
# @return [Boolean] Allows explicitly marking a query as being readonly and not mutating any documents on the server side.
|
34
|
+
attr_accessor :readonly
|
35
|
+
|
36
|
+
# Allows customizing how long (in milliseconds) the query engine is willing to wait until the index catches up to whatever scan consistency is asked for in this query.
|
37
|
+
#
|
38
|
+
# @note that if +:not_bounded+ consistency level is used, this method doesn't do anything
|
39
|
+
# at all. If no value is provided to this method, the server default is used.
|
40
|
+
#
|
41
|
+
# @return [Integer] The maximum duration (in milliseconds) the query engine is willing to wait before failing.
|
42
|
+
attr_accessor :scan_wait
|
43
|
+
|
44
|
+
# @return [Integer] Supports customizing the maximum buffered channel size between the indexer and the query service
|
45
|
+
attr_accessor :scan_cap
|
46
|
+
|
47
|
+
# @return [Integer] Supports customizing the number of items execution operators can batch for fetch from the KV layer on the server.
|
48
|
+
attr_accessor :pipeline_batch
|
49
|
+
|
50
|
+
# @return [Integer] Allows customizing the maximum number of items each execution operator can buffer between various operators on the server.
|
51
|
+
attr_accessor :pipeline_cap
|
52
|
+
|
53
|
+
# @return [Boolean] Enables per-request metrics in the trailing section of the query
|
54
|
+
attr_accessor :metrics
|
55
|
+
|
56
|
+
# @return [:off, :phases, :timings] Customize server profile level for this query
|
57
|
+
attr_accessor :profile
|
58
|
+
|
59
|
+
# @return [:not_bounded, :request_plus]
|
60
|
+
attr_reader :scan_consistency
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
# @return [MutationState]
|
64
|
+
attr_reader :mutation_state
|
65
|
+
|
66
|
+
# @api private
|
67
|
+
# @return [Hash<String => #to_json>]
|
68
|
+
attr_reader :raw_parameters
|
69
|
+
|
70
|
+
# @yieldparam [QueryOptions] self
|
71
|
+
def initialize
|
72
|
+
@timeout = 75_000 # ms
|
73
|
+
@adhoc = true
|
74
|
+
@raw_parameters = {}
|
75
|
+
@positional_parameters = nil
|
76
|
+
@named_parameters = nil
|
77
|
+
@scan_consistency = nil
|
78
|
+
@mutation_state = nil
|
79
|
+
yield self if block_given?
|
80
|
+
end
|
81
|
+
|
82
|
+
# Allows providing custom JSON key/value pairs for advanced usage
|
83
|
+
#
|
84
|
+
# @param [String] key the parameter name (key of the JSON property)
|
85
|
+
# @param [Object] value the parameter value (value of the JSON property)
|
86
|
+
def raw(key, value)
|
87
|
+
@raw_parameters[key] = JSON.generate(value)
|
88
|
+
end
|
89
|
+
|
90
|
+
# Customizes the consistency guarantees for this query
|
91
|
+
#
|
92
|
+
# @note overrides consistency level set by {#consistent_with}
|
93
|
+
#
|
94
|
+
# [+:not_bounded+] The indexer will return whatever state it has to the query engine at the time of query. This is the default (for single-statement requests).
|
95
|
+
#
|
96
|
+
# [+:request_plus+] The indexer will wait until all mutations have been processed at the time of request before returning to the query engine.
|
97
|
+
#
|
98
|
+
# @param [:not_bounded, :request_plus] level the index scan consistency to be used for this query
|
99
|
+
def scan_consistency=(level)
|
100
|
+
@mutation_state = nil if @mutation_state
|
101
|
+
@scan_consistency = level
|
102
|
+
end
|
103
|
+
|
104
|
+
# Sets the mutation tokens this query should be consistent with
|
105
|
+
#
|
106
|
+
# @note overrides consistency level set by {#scan_consistency=}
|
107
|
+
#
|
108
|
+
# @param [MutationState] mutation_state the mutation state containing the mutation tokens
|
109
|
+
def consistent_with(mutation_state)
|
110
|
+
@scan_consistency = nil if @scan_consistency
|
111
|
+
@mutation_state = mutation_state
|
112
|
+
end
|
113
|
+
|
114
|
+
# Sets positional parameters for the query
|
115
|
+
#
|
116
|
+
# @param [Array] positional the list of parameters that have to be substituted in the statement
|
117
|
+
def positional_parameters(positional)
|
118
|
+
@positional_parameters = positional
|
119
|
+
@named_parameters = nil
|
120
|
+
end
|
121
|
+
|
122
|
+
# @api private
|
123
|
+
# @return [Array<String>, nil]
|
124
|
+
def export_positional_parameters
|
125
|
+
@positional_parameters.map { |p| JSON.dump(p) } if @positional_parameters
|
126
|
+
end
|
127
|
+
|
128
|
+
# Sets named parameters for the query
|
129
|
+
#
|
130
|
+
# @param [Hash] named the key/value map of the parameters to substitute in the statement
|
131
|
+
def named_parameters(named)
|
132
|
+
@named_parameters = named
|
133
|
+
@positional_parameters = nil
|
134
|
+
end
|
135
|
+
|
136
|
+
# @api private
|
137
|
+
# @return [Hash<String => String>, nil]
|
138
|
+
def export_named_parameters
|
139
|
+
@named_parameters.each_with_object({}) { |(n, v), o| o[n.to_s] = JSON.dump(v) } if @named_parameters
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
class QueryResult
|
144
|
+
# @return [QueryMetaData] returns object representing additional metadata associated with this query
|
145
|
+
attr_accessor :meta_data
|
146
|
+
|
147
|
+
attr_accessor :transcoder
|
148
|
+
|
149
|
+
# Returns all rows converted using a transcoder
|
150
|
+
#
|
151
|
+
# @return [Array]
|
152
|
+
def rows(transcoder = self.transcoder)
|
153
|
+
@rows.lazy.map do |row|
|
154
|
+
if transcoder == :json
|
155
|
+
JSON.parse(row)
|
156
|
+
else
|
157
|
+
transcoder.call(row)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
# @yieldparam [QueryResult] self
|
163
|
+
def initialize
|
164
|
+
yield self if block_given?
|
165
|
+
@transcoder = :json
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
class QueryMetaData
|
170
|
+
# @return [String] returns the request identifier string of the query request
|
171
|
+
attr_accessor :request_id
|
172
|
+
|
173
|
+
# @return [String] returns the client context identifier string set of the query request
|
174
|
+
attr_accessor :client_context_id
|
175
|
+
|
176
|
+
# @return [Symbol] returns raw query execution status as returned by the query engine
|
177
|
+
attr_accessor :status
|
178
|
+
|
179
|
+
# @return [Hash] returns the signature as returned by the query engine which is then decoded as JSON object
|
180
|
+
attr_accessor :signature
|
181
|
+
|
182
|
+
# @return [Hash] returns the profiling information returned by the query engine which is then decoded as JSON object
|
183
|
+
attr_accessor :profile
|
184
|
+
|
185
|
+
# @return [QueryMetrics] metrics as returned by the query engine, if enabled
|
186
|
+
attr_accessor :metrics
|
187
|
+
|
188
|
+
# @return [Array<QueryWarning>] list of warnings returned by the query engine
|
189
|
+
attr_accessor :warnings
|
190
|
+
|
191
|
+
# @yieldparam [QueryMetaData] self
|
192
|
+
def initialize
|
193
|
+
yield self if block_given?
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
class QueryMetrics
|
198
|
+
# @return [Integer] The total time taken for the request, that is the time from when the request was received until the results were returned
|
199
|
+
attr_accessor :elapsed_time
|
200
|
+
|
201
|
+
# @return [Integer] The time taken for the execution of the request, that is the time from when query execution started until the results were returned
|
202
|
+
attr_accessor :execution_time
|
203
|
+
|
204
|
+
# @return [Integer] the total number of results selected by the engine before restriction through LIMIT clause.
|
205
|
+
attr_accessor :sort_count
|
206
|
+
|
207
|
+
# @return [Integer] The total number of objects in the results.
|
208
|
+
attr_accessor :result_count
|
209
|
+
|
210
|
+
# @return [Integer] The total number of bytes in the results.
|
211
|
+
attr_accessor :result_size
|
212
|
+
|
213
|
+
# @return [Integer] The number of mutations that were made during the request.
|
214
|
+
attr_accessor :mutation_count
|
215
|
+
|
216
|
+
# @return [Integer] The number of errors that occurred during the request.
|
217
|
+
attr_accessor :error_count
|
218
|
+
|
219
|
+
# @return [Integer] The number of warnings that occurred during the request.
|
220
|
+
attr_accessor :warning_count
|
221
|
+
|
222
|
+
# @yieldparam [QueryMetrics] self
|
223
|
+
def initialize
|
224
|
+
yield self if block_given?
|
225
|
+
end
|
226
|
+
end
|
227
|
+
|
228
|
+
# Represents a single warning returned from the query engine.
|
229
|
+
class QueryWarning
|
230
|
+
# @return [Integer]
|
231
|
+
attr_accessor :code
|
232
|
+
|
233
|
+
# @return [String]
|
234
|
+
attr_accessor :message
|
235
|
+
|
236
|
+
def initialize(code, message)
|
237
|
+
@code = code
|
238
|
+
@message = message
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
data/lib/couchbase/scope.rb
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
-
require
|
15
|
+
require "couchbase/collection"
|
16
16
|
|
17
17
|
module Couchbase
|
18
18
|
class Scope
|
@@ -23,20 +23,13 @@ module Couchbase
|
|
23
23
|
|
24
24
|
# @param [Couchbase::Backend] backend
|
25
25
|
# @param [String] bucket_name name of the bucket
|
26
|
-
# @param [String, :
|
26
|
+
# @param [String, :_default] scope_name name of the scope
|
27
27
|
def initialize(backend, bucket_name, scope_name)
|
28
28
|
@backend = backend
|
29
29
|
@bucket_name = bucket_name
|
30
30
|
@name = scope_name
|
31
31
|
end
|
32
32
|
|
33
|
-
# Opens the default collection for this scope
|
34
|
-
#
|
35
|
-
# @return [Collection]
|
36
|
-
def default_collection
|
37
|
-
Collection.new(@backend, @bucket_name, @name, :default)
|
38
|
-
end
|
39
|
-
|
40
33
|
# Opens the default collection for this scope
|
41
34
|
#
|
42
35
|
# @param [String] collection_name name of the collection
|
@@ -46,4 +39,4 @@ module Couchbase
|
|
46
39
|
Collection.new(@backend, @bucket_name, @name, collection_name)
|
47
40
|
end
|
48
41
|
end
|
49
|
-
end
|
42
|
+
end
|
@@ -0,0 +1,1499 @@
|
|
1
|
+
# Copyright 2020 Couchbase, Inc.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Couchbase
|
16
|
+
class Cluster
|
17
|
+
class SearchQuery
|
18
|
+
# Prepare {MatchQuery} body
|
19
|
+
#
|
20
|
+
# @param [String] match
|
21
|
+
# @yieldparam [MatchQuery] query
|
22
|
+
#
|
23
|
+
# @return [MatchQuery]
|
24
|
+
def self.match(match, &block)
|
25
|
+
MatchQuery.new(match, &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
# A match query analyzes the input text and uses that analyzed text to query the index.
|
29
|
+
class MatchQuery < SearchQuery
|
30
|
+
# @return [Float]
|
31
|
+
attr_accessor :boost
|
32
|
+
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :field
|
35
|
+
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :analyzer
|
38
|
+
|
39
|
+
# @return [Integer]
|
40
|
+
attr_accessor :prefix_length
|
41
|
+
|
42
|
+
# @return [Integer]
|
43
|
+
attr_accessor :fuzziness
|
44
|
+
|
45
|
+
# @param [String] match
|
46
|
+
# @yieldparam [MatchQuery] self
|
47
|
+
def initialize(match)
|
48
|
+
super()
|
49
|
+
@match = match
|
50
|
+
yield self if block_given?
|
51
|
+
end
|
52
|
+
|
53
|
+
# @return [String]
|
54
|
+
def to_json(*args)
|
55
|
+
data = {"match" => @match}
|
56
|
+
data["boost"] = boost if boost
|
57
|
+
data["field"] = field if field
|
58
|
+
data["analyzer"] = analyzer if analyzer
|
59
|
+
if fuzziness
|
60
|
+
data["fuzziness"] = fuzziness
|
61
|
+
data["prefix_length"] = prefix_length if prefix_length
|
62
|
+
end
|
63
|
+
data.to_json(*args)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Prepare {MatchPhraseQuery} body
|
68
|
+
#
|
69
|
+
# @param [String] match_phrase
|
70
|
+
# @yieldparam [MatchPhraseQuery] query
|
71
|
+
#
|
72
|
+
# @return [MatchPhraseQuery]
|
73
|
+
def self.match_phrase(match_phrase, &block)
|
74
|
+
MatchPhraseQuery.new(match_phrase, &block)
|
75
|
+
end
|
76
|
+
|
77
|
+
# The input text is analyzed and a phrase query is built with the terms resulting from the analysis.
|
78
|
+
class MatchPhraseQuery < SearchQuery
|
79
|
+
# @return [Float]
|
80
|
+
attr_accessor :boost
|
81
|
+
|
82
|
+
# @return [String]
|
83
|
+
attr_accessor :field
|
84
|
+
|
85
|
+
# @return [String]
|
86
|
+
attr_accessor :analyzer
|
87
|
+
|
88
|
+
# @param [String] match_phrase
|
89
|
+
#
|
90
|
+
# @yieldparam [MatchPhraseQuery] self
|
91
|
+
def initialize(match_phrase)
|
92
|
+
super()
|
93
|
+
@match_phrase = match_phrase
|
94
|
+
yield self if block_given?
|
95
|
+
end
|
96
|
+
|
97
|
+
# @return [String]
|
98
|
+
def to_json(*args)
|
99
|
+
data = {"match_phrase" => @match_phrase}
|
100
|
+
data["boost"] = boost if boost
|
101
|
+
data["field"] = field if field
|
102
|
+
data["analyzer"] = analyzer if analyzer
|
103
|
+
data.to_json(*args)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
# Prepare {RegexpQuery} body
|
108
|
+
#
|
109
|
+
# @param [String] regexp
|
110
|
+
# @yieldparam [RegexpQuery] query
|
111
|
+
#
|
112
|
+
# @return [RegexpQuery]
|
113
|
+
def self.regexp(regexp, &block)
|
114
|
+
RegexpQuery.new(regexp, &block)
|
115
|
+
end
|
116
|
+
|
117
|
+
# Finds documents containing terms that match the specified regular expression.
|
118
|
+
class RegexpQuery < SearchQuery
|
119
|
+
# @return [Float]
|
120
|
+
attr_accessor :boost
|
121
|
+
|
122
|
+
# @return [String]
|
123
|
+
attr_accessor :field
|
124
|
+
|
125
|
+
# @param [String] regexp
|
126
|
+
#
|
127
|
+
# @yieldparam [RegexpQuery] self
|
128
|
+
def initialize(regexp)
|
129
|
+
super()
|
130
|
+
@regexp = regexp
|
131
|
+
yield self if block_given?
|
132
|
+
end
|
133
|
+
|
134
|
+
# @return [String]
|
135
|
+
def to_json(*args)
|
136
|
+
data = {"regexp" => @regexp}
|
137
|
+
data["boost"] = boost if boost
|
138
|
+
data["field"] = field if field
|
139
|
+
data.to_json(*args)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Prepare {QueryStringQuery} body
|
144
|
+
#
|
145
|
+
# @param [String] query_string
|
146
|
+
# @yieldparam [QueryStringQuery] query
|
147
|
+
#
|
148
|
+
# @return [QueryStringQuery]
|
149
|
+
def self.query_string(query_string, &block)
|
150
|
+
QueryStringQuery.new(query_string, &block)
|
151
|
+
end
|
152
|
+
|
153
|
+
# The query string query allows humans to describe complex queries using a simple syntax.
|
154
|
+
class QueryStringQuery < SearchQuery
|
155
|
+
# @return [Float]
|
156
|
+
attr_accessor :boost
|
157
|
+
|
158
|
+
# @param [String] query_string
|
159
|
+
#
|
160
|
+
# @yieldparam [QueryStringQuery] self
|
161
|
+
def initialize(query_string)
|
162
|
+
super()
|
163
|
+
@query_string = query_string
|
164
|
+
yield self if block_given?
|
165
|
+
end
|
166
|
+
|
167
|
+
# @return [String]
|
168
|
+
def to_json(*args)
|
169
|
+
data = {"query" => @query_string}
|
170
|
+
data["boost"] = boost if boost
|
171
|
+
data.to_json(*args)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Prepare {WildcardQuery} body
|
176
|
+
#
|
177
|
+
# @param [String] wildcard
|
178
|
+
# @yieldparam [WildcardQuery] query
|
179
|
+
#
|
180
|
+
# @return [WildcardQuery]
|
181
|
+
def self.wildcard(wildcard, &block)
|
182
|
+
WildcardQuery.new(wildcard, &block)
|
183
|
+
end
|
184
|
+
|
185
|
+
# Interprets * and ? wildcards as found in a lot of applications, for an easy implementation of such a search feature.
|
186
|
+
class WildcardQuery < SearchQuery
|
187
|
+
# @return [Float]
|
188
|
+
attr_accessor :boost
|
189
|
+
|
190
|
+
# @return [String]
|
191
|
+
attr_accessor :field
|
192
|
+
|
193
|
+
# @param [String] wildcard
|
194
|
+
#
|
195
|
+
# @yieldparam [WildcardQuery] self
|
196
|
+
def initialize(wildcard)
|
197
|
+
super()
|
198
|
+
@wildcard = wildcard
|
199
|
+
yield self if block_given?
|
200
|
+
end
|
201
|
+
|
202
|
+
# @return [String]
|
203
|
+
def to_json(*args)
|
204
|
+
data = {"wildcard" => @wildcard}
|
205
|
+
data["boost"] = boost if boost
|
206
|
+
data["field"] = field if field
|
207
|
+
data.to_json(*args)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
# Prepare {DocIdQuery} body
|
212
|
+
#
|
213
|
+
# @param [String...] doc_ids
|
214
|
+
# @yieldparam [DocIdQuery] query
|
215
|
+
#
|
216
|
+
# @return [DocIdQuery]
|
217
|
+
def self.doc_id(*doc_ids)
|
218
|
+
DocIdQuery.new(*doc_ids)
|
219
|
+
end
|
220
|
+
|
221
|
+
# Allows to restrict matches to a set of specific documents.
|
222
|
+
class DocIdQuery < SearchQuery
|
223
|
+
# @return [Float]
|
224
|
+
attr_accessor :boost
|
225
|
+
|
226
|
+
# @return [String]
|
227
|
+
attr_accessor :field
|
228
|
+
|
229
|
+
# @param [String...] doc_ids
|
230
|
+
#
|
231
|
+
# @yieldparam [DocIdQuery] self
|
232
|
+
def initialize(*doc_ids)
|
233
|
+
super()
|
234
|
+
@doc_ids = doc_ids
|
235
|
+
yield self if block_given?
|
236
|
+
end
|
237
|
+
|
238
|
+
# @return [String]
|
239
|
+
def to_json(*args)
|
240
|
+
data = {"doc_ids" => @doc_ids.flatten.uniq}
|
241
|
+
data["boost"] = boost if boost
|
242
|
+
data["field"] = field if field
|
243
|
+
data.to_json(*args)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
# Prepare {BooleanFieldQuery} body
|
248
|
+
#
|
249
|
+
# @param [Boolean] value
|
250
|
+
# @yieldparam [BooleanFieldQuery] query
|
251
|
+
#
|
252
|
+
# @return [BooleanFieldQuery]
|
253
|
+
def self.boolean_field(value)
|
254
|
+
BooleanFieldQuery.new(value)
|
255
|
+
end
|
256
|
+
|
257
|
+
# Allow to match `true`/`false` in a field mapped as boolean.
|
258
|
+
class BooleanFieldQuery < SearchQuery
|
259
|
+
# @return [Float]
|
260
|
+
attr_accessor :boost
|
261
|
+
|
262
|
+
# @return [String]
|
263
|
+
attr_accessor :field
|
264
|
+
|
265
|
+
# @param [Boolean] value
|
266
|
+
#
|
267
|
+
# @yieldparam [BooleanFieldQuery] self
|
268
|
+
def initialize(value)
|
269
|
+
super()
|
270
|
+
@value = value
|
271
|
+
yield self if block_given?
|
272
|
+
end
|
273
|
+
|
274
|
+
# @return [String]
|
275
|
+
def to_json(*args)
|
276
|
+
data = {"bool" => @value}
|
277
|
+
data["boost"] = boost if boost
|
278
|
+
data["field"] = field if field
|
279
|
+
data.to_json(*args)
|
280
|
+
end
|
281
|
+
end
|
282
|
+
|
283
|
+
# Prepare {DateRangeQuery} body
|
284
|
+
#
|
285
|
+
# @yieldparam [DateRangeQuery] query
|
286
|
+
#
|
287
|
+
# @return [DateRangeQuery]
|
288
|
+
def self.date_range(&block)
|
289
|
+
DateRangeQuery.new(&block)
|
290
|
+
end
|
291
|
+
|
292
|
+
# The date range query finds documents containing a date value in the specified field within the specified range.
|
293
|
+
class DateRangeQuery < SearchQuery
|
294
|
+
# @return [Float]
|
295
|
+
attr_accessor :boost
|
296
|
+
|
297
|
+
# @return [String]
|
298
|
+
attr_accessor :field
|
299
|
+
|
300
|
+
# @return [String]
|
301
|
+
attr_accessor :date_time_parser
|
302
|
+
|
303
|
+
# Sets the lower boundary of the range.
|
304
|
+
#
|
305
|
+
# @note The lower boundary is considered inclusive by default on the server side.
|
306
|
+
#
|
307
|
+
# @param [Time, String] time_point start time. When +Time+ object is passed {#date_time_parser} must be +nil+ (to use server default)
|
308
|
+
# @param [Boolean] inclusive
|
309
|
+
def start_time(time_point, inclusive = nil)
|
310
|
+
@start_time = time_point
|
311
|
+
@start_inclusive = inclusive
|
312
|
+
end
|
313
|
+
|
314
|
+
# Sets the upper boundary of the range.
|
315
|
+
#
|
316
|
+
# @note The upper boundary is considered exclusive by default on the server side.
|
317
|
+
#
|
318
|
+
# @param [Time, String] time_point end time. When +Time+ object is passed {#date_time_parser} must be +nil+ (to use server default)
|
319
|
+
# @param [Boolean] inclusive
|
320
|
+
def end_time(time_point, inclusive = nil)
|
321
|
+
@end_time = time_point
|
322
|
+
@end_inclusive = inclusive
|
323
|
+
end
|
324
|
+
|
325
|
+
# @yieldparam [DateRangeQuery] self
|
326
|
+
def initialize
|
327
|
+
super
|
328
|
+
@start_time = nil
|
329
|
+
@start_inclusive = nil
|
330
|
+
@end_time = nil
|
331
|
+
@end_inclusive = nil
|
332
|
+
yield self if block_given?
|
333
|
+
end
|
334
|
+
|
335
|
+
DATE_FORMAT_RFC3339 = "%Y-%m-%dT%H:%M:%S%:z"
|
336
|
+
|
337
|
+
# @return [String]
|
338
|
+
def to_json(*args)
|
339
|
+
if @start_time.nil? && @end_time.nil?
|
340
|
+
raise ArgumentError, "either start_time or end_time must be set for DateRangeQuery"
|
341
|
+
end
|
342
|
+
|
343
|
+
data = {}
|
344
|
+
data["boost"] = boost if boost
|
345
|
+
data["field"] = field if field
|
346
|
+
data["datetime_parser"] = date_time_parser if date_time_parser
|
347
|
+
if @start_time
|
348
|
+
data["start"] = if @start_time.respond_to?(:strftime)
|
349
|
+
@start_time.strftime(DATE_FORMAT_RFC3339)
|
350
|
+
else
|
351
|
+
@start_time
|
352
|
+
end
|
353
|
+
data["inclusive_start"] = @start_inclusive unless @start_inclusive.nil?
|
354
|
+
end
|
355
|
+
if @end_time
|
356
|
+
data["end"] = if @end_time.respond_to?(:strftime)
|
357
|
+
@end_time.strftime(DATE_FORMAT_RFC3339)
|
358
|
+
else
|
359
|
+
@end_time
|
360
|
+
end
|
361
|
+
data["inclusive_end"] = @end_inclusive unless @end_inclusive.nil?
|
362
|
+
end
|
363
|
+
data.to_json(*args)
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
# Prepare {NumericRangeQuery} body
|
368
|
+
#
|
369
|
+
# @yieldparam [NumericRangeQuery] query
|
370
|
+
#
|
371
|
+
# @return [NumericRangeQuery]
|
372
|
+
def self.numeric_range(&block)
|
373
|
+
NumericRangeQuery.new(&block)
|
374
|
+
end
|
375
|
+
|
376
|
+
# The numeric range query finds documents containing a numeric value in the specified field within the specified range.
|
377
|
+
class NumericRangeQuery < SearchQuery
|
378
|
+
# @return [Float]
|
379
|
+
attr_accessor :boost
|
380
|
+
|
381
|
+
# @return [String]
|
382
|
+
attr_accessor :field
|
383
|
+
|
384
|
+
# Sets lower bound of the range.
|
385
|
+
#
|
386
|
+
# The lower boundary is considered inclusive by default on the server side.
|
387
|
+
#
|
388
|
+
# @param [Numeric] lower_bound
|
389
|
+
# @param [Boolean] inclusive
|
390
|
+
def min(lower_bound, inclusive = nil)
|
391
|
+
@min = lower_bound
|
392
|
+
@min_inclusive = inclusive
|
393
|
+
end
|
394
|
+
|
395
|
+
# Sets upper bound of the range.
|
396
|
+
#
|
397
|
+
# The upper boundary is considered exclusive by default on the server side.
|
398
|
+
#
|
399
|
+
# @param [Numeric] upper_bound
|
400
|
+
# @param [Boolean] inclusive
|
401
|
+
def max(upper_bound, inclusive = nil)
|
402
|
+
@max = upper_bound
|
403
|
+
@max_inclusive = inclusive
|
404
|
+
end
|
405
|
+
|
406
|
+
# @yieldparam [NumericRangeQuery] self
|
407
|
+
def initialize
|
408
|
+
super
|
409
|
+
@min = nil
|
410
|
+
@min_inclusive = nil
|
411
|
+
@max = nil
|
412
|
+
@max_inclusive = nil
|
413
|
+
yield self if block_given?
|
414
|
+
end
|
415
|
+
|
416
|
+
# @return [String]
|
417
|
+
def to_json(*args)
|
418
|
+
if @min.nil? && @max.nil?
|
419
|
+
raise ArgumentError, "either min or max must be set for NumericRangeQuery"
|
420
|
+
end
|
421
|
+
|
422
|
+
data = {}
|
423
|
+
data["boost"] = boost if boost
|
424
|
+
data["field"] = field if field
|
425
|
+
if @min
|
426
|
+
data["min"] = @min
|
427
|
+
data["inclusive_min"] = @min_inclusive unless @min_inclusive.nil?
|
428
|
+
end
|
429
|
+
if @max
|
430
|
+
data["max"] = @max
|
431
|
+
data["inclusive_max"] = @max_inclusive unless @max_inclusive.nil?
|
432
|
+
end
|
433
|
+
data.to_json(*args)
|
434
|
+
end
|
435
|
+
end
|
436
|
+
|
437
|
+
# Prepare {TermRangeQuery} body
|
438
|
+
#
|
439
|
+
# @yieldparam [TermRangeQuery] query
|
440
|
+
#
|
441
|
+
# @return [TermRangeQuery]
|
442
|
+
def self.term_range(&block)
|
443
|
+
TermRangeQuery.new(&block)
|
444
|
+
end
|
445
|
+
|
446
|
+
# The term range query finds documents containing a string value in the specified field within the specified range.
|
447
|
+
class TermRangeQuery < SearchQuery
|
448
|
+
# @return [Float]
|
449
|
+
attr_accessor :boost
|
450
|
+
|
451
|
+
# @return [String]
|
452
|
+
attr_accessor :field
|
453
|
+
|
454
|
+
# Sets lower bound of the range.
|
455
|
+
#
|
456
|
+
# The lower boundary is considered inclusive by default on the server side.
|
457
|
+
#
|
458
|
+
# @param [String] lower_bound
|
459
|
+
# @param [Boolean] inclusive
|
460
|
+
def min(lower_bound, inclusive = nil)
|
461
|
+
@min = lower_bound
|
462
|
+
@min_inclusive = inclusive
|
463
|
+
end
|
464
|
+
|
465
|
+
# Sets upper bound of the range.
|
466
|
+
#
|
467
|
+
# The upper boundary is considered exclusive by default on the server side.
|
468
|
+
#
|
469
|
+
# @param [String] upper_bound
|
470
|
+
# @param [Boolean] inclusive
|
471
|
+
def max(upper_bound, inclusive = nil)
|
472
|
+
@max = upper_bound
|
473
|
+
@max_inclusive = inclusive
|
474
|
+
end
|
475
|
+
|
476
|
+
# @yieldparam [TermRangeQuery] self
|
477
|
+
def initialize
|
478
|
+
super
|
479
|
+
@min = nil
|
480
|
+
@min_inclusive = nil
|
481
|
+
@max = nil
|
482
|
+
@max_inclusive = nil
|
483
|
+
yield self if block_given?
|
484
|
+
end
|
485
|
+
|
486
|
+
# @return [String]
|
487
|
+
def to_json(*args)
|
488
|
+
if @min.nil? && @max.nil?
|
489
|
+
raise ArgumentError, "either min or max must be set for TermRangeQuery"
|
490
|
+
end
|
491
|
+
|
492
|
+
data = {}
|
493
|
+
data["boost"] = boost if boost
|
494
|
+
data["field"] = field if field
|
495
|
+
if @min
|
496
|
+
data["min"] = @min
|
497
|
+
data["inclusive_min"] = @min_inclusive unless @min_inclusive.nil?
|
498
|
+
end
|
499
|
+
if @max
|
500
|
+
data["max"] = @max
|
501
|
+
data["inclusive_max"] = @max_inclusive unless @max_inclusive.nil?
|
502
|
+
end
|
503
|
+
data.to_json(*args)
|
504
|
+
end
|
505
|
+
end
|
506
|
+
|
507
|
+
# Prepare {GeoDistanceQuery} body
|
508
|
+
#
|
509
|
+
# @yieldparam [GeoDistanceQuery] query
|
510
|
+
#
|
511
|
+
# @param [Float] latitude location latitude
|
512
|
+
# @param [Float] longitude location longitude
|
513
|
+
# @param [String] distance how big is area (number with units)
|
514
|
+
#
|
515
|
+
# @return [GeoDistanceQuery]
|
516
|
+
def self.geo_distance(longitude, latitude, distance, &block)
|
517
|
+
GeoDistanceQuery.new(longitude, latitude, distance, &block)
|
518
|
+
end
|
519
|
+
|
520
|
+
# Finds `geopoint` indexed matches around a point with the given distance.
|
521
|
+
class GeoDistanceQuery < SearchQuery
|
522
|
+
# @return [Float]
|
523
|
+
attr_accessor :boost
|
524
|
+
|
525
|
+
# @return [String]
|
526
|
+
attr_accessor :field
|
527
|
+
|
528
|
+
# @yieldparam [GeoDistanceQuery] self
|
529
|
+
# @param [Float] longitude
|
530
|
+
# @param [Float] latitude
|
531
|
+
# @param [Float] distance
|
532
|
+
def initialize(longitude, latitude, distance)
|
533
|
+
super()
|
534
|
+
@longitude = longitude
|
535
|
+
@latitude = latitude
|
536
|
+
@distance = distance
|
537
|
+
yield self if block_given?
|
538
|
+
end
|
539
|
+
|
540
|
+
# @return [String]
|
541
|
+
def to_json(*args)
|
542
|
+
data = {
|
543
|
+
"location" => [@longitude, @latitude],
|
544
|
+
"distance" => @distance
|
545
|
+
}
|
546
|
+
data["boost"] = boost if boost
|
547
|
+
data["field"] = field if field
|
548
|
+
data.to_json(*args)
|
549
|
+
end
|
550
|
+
end
|
551
|
+
|
552
|
+
# Prepare {GeoBoundingBoxQuery} body
|
553
|
+
#
|
554
|
+
# @yieldparam [GeoDistanceQuery] query
|
555
|
+
#
|
556
|
+
# @param [Float] top_left_longitude
|
557
|
+
# @param [Float] top_left_latitude
|
558
|
+
# @param [Float] bottom_right_longitude
|
559
|
+
# @param [Float] bottom_right_latitude
|
560
|
+
#
|
561
|
+
# @return [GeoBoundingBoxQuery]
|
562
|
+
def self.geo_bounding_box(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude, &block)
|
563
|
+
GeoBoundingBoxQuery.new(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude, &block)
|
564
|
+
end
|
565
|
+
|
566
|
+
# Finds `geopoint` indexed matches in a given bounding box.
|
567
|
+
class GeoBoundingBoxQuery < SearchQuery
|
568
|
+
# @return [Float]
|
569
|
+
attr_accessor :boost
|
570
|
+
|
571
|
+
# @return [String]
|
572
|
+
attr_accessor :field
|
573
|
+
|
574
|
+
# @yieldparam [GeoBoundingBoxQuery] self
|
575
|
+
#
|
576
|
+
# @param [Float] top_left_longitude
|
577
|
+
# @param [Float] top_left_latitude
|
578
|
+
# @param [Float] bottom_right_longitude
|
579
|
+
# @param [Float] bottom_right_latitude
|
580
|
+
def initialize(top_left_longitude, top_left_latitude, bottom_right_longitude, bottom_right_latitude)
|
581
|
+
super()
|
582
|
+
@top_left_longitude = top_left_longitude
|
583
|
+
@top_left_latitude = top_left_latitude
|
584
|
+
@bottom_right_longitude = bottom_right_longitude
|
585
|
+
@bottom_right_latitude = bottom_right_latitude
|
586
|
+
yield self if block_given?
|
587
|
+
end
|
588
|
+
|
589
|
+
# @return [String]
|
590
|
+
def to_json(*args)
|
591
|
+
data = {
|
592
|
+
"top_left" => [@top_left_longitude, @top_left_latitude],
|
593
|
+
"bottom_right" => [@bottom_right_longitude, @bottom_right_latitude]
|
594
|
+
}
|
595
|
+
data["boost"] = boost if boost
|
596
|
+
data["field"] = field if field
|
597
|
+
data.to_json(*args)
|
598
|
+
end
|
599
|
+
end
|
600
|
+
|
601
|
+
# Prepare {ConjunctionQuery} body
|
602
|
+
#
|
603
|
+
# @yieldparam [ConjunctionQuery] query
|
604
|
+
#
|
605
|
+
# @return [ConjunctionQuery]
|
606
|
+
def self.conjuncts(*queries, &block)
|
607
|
+
ConjunctionQuery.new(*queries, &block)
|
608
|
+
end
|
609
|
+
|
610
|
+
# Result documents must satisfy all of the child queries.
|
611
|
+
class ConjunctionQuery < SearchQuery
|
612
|
+
# @return [Float]
|
613
|
+
attr_accessor :boost
|
614
|
+
|
615
|
+
# @yieldparam [ConjunctionQuery] self
|
616
|
+
#
|
617
|
+
# @param [*SearchQuery] queries
|
618
|
+
def initialize(*queries)
|
619
|
+
super()
|
620
|
+
@queries = queries.flatten
|
621
|
+
yield self if block_given?
|
622
|
+
end
|
623
|
+
|
624
|
+
# @param [*SearchQuery] queries
|
625
|
+
def and_also(*queries)
|
626
|
+
@queries |= queries.flatten
|
627
|
+
end
|
628
|
+
|
629
|
+
def empty?
|
630
|
+
@queries.empty?
|
631
|
+
end
|
632
|
+
|
633
|
+
# @return [String]
|
634
|
+
def to_json(*args)
|
635
|
+
raise ArgumentError, "compound conjunction query must have sub-queries" if @queries.nil? || @queries.empty?
|
636
|
+
data = {"conjuncts" => @queries.uniq}
|
637
|
+
data["boost"] = boost if boost
|
638
|
+
data.to_json(*args)
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
# Prepare {ConjunctionQuery} body
|
643
|
+
#
|
644
|
+
# @yieldparam [ConjunctionQuery] query
|
645
|
+
#
|
646
|
+
# @return [ConjunctionQuery]
|
647
|
+
def self.disjuncts(*queries, &block)
|
648
|
+
DisjunctionQuery.new(*queries, &block)
|
649
|
+
end
|
650
|
+
|
651
|
+
# Result documents must satisfy a configurable min number of child queries.
|
652
|
+
class DisjunctionQuery < SearchQuery
|
653
|
+
# @return [Float]
|
654
|
+
attr_accessor :boost
|
655
|
+
|
656
|
+
# @return [Integer]
|
657
|
+
attr_accessor :min
|
658
|
+
|
659
|
+
# @yieldparam [DisjunctionQuery] self
|
660
|
+
#
|
661
|
+
# @param [*SearchQuery] queries
|
662
|
+
def initialize(*queries)
|
663
|
+
super()
|
664
|
+
@queries = queries.flatten
|
665
|
+
yield self if block_given?
|
666
|
+
end
|
667
|
+
|
668
|
+
# @param [*SearchQuery] queries
|
669
|
+
def or_else(*queries)
|
670
|
+
@queries |= queries.flatten
|
671
|
+
end
|
672
|
+
|
673
|
+
def empty?
|
674
|
+
@queries.empty?
|
675
|
+
end
|
676
|
+
|
677
|
+
# @return [String]
|
678
|
+
def to_json(*args)
|
679
|
+
raise ArgumentError, "compound disjunction query must have sub-queries" if @queries.nil? || @queries.empty?
|
680
|
+
data = {"disjuncts" => @queries.uniq}
|
681
|
+
if min
|
682
|
+
raise ArgumentError, "disjunction query has fewer sub-queries than configured minimum" if @queries.size < min
|
683
|
+
data["min"] = min
|
684
|
+
end
|
685
|
+
data["boost"] = boost if boost
|
686
|
+
data.to_json(*args)
|
687
|
+
end
|
688
|
+
end
|
689
|
+
|
690
|
+
# Prepare {BooleanQuery} body
|
691
|
+
#
|
692
|
+
# @yieldparam [BooleanQuery] query
|
693
|
+
#
|
694
|
+
# @return [BooleanQuery]
|
695
|
+
def self.booleans(&block)
|
696
|
+
BooleanQuery.new(&block)
|
697
|
+
end
|
698
|
+
|
699
|
+
# The boolean query is a useful combination of conjunction and disjunction queries.
|
700
|
+
class BooleanQuery < SearchQuery
|
701
|
+
# @return [Float]
|
702
|
+
attr_accessor :boost
|
703
|
+
|
704
|
+
# @yieldparam [BooleanQuery] self
|
705
|
+
def initialize
|
706
|
+
super()
|
707
|
+
@must = ConjunctionQuery.new
|
708
|
+
@must_not = DisjunctionQuery.new
|
709
|
+
@should = DisjunctionQuery.new
|
710
|
+
yield self if block_given?
|
711
|
+
end
|
712
|
+
|
713
|
+
# @param [Integer] min minimal value for "should" disjunction query
|
714
|
+
def should_min(min)
|
715
|
+
@should.min = min
|
716
|
+
self
|
717
|
+
end
|
718
|
+
|
719
|
+
# @param [*SearchQuery] queries
|
720
|
+
def must(*queries)
|
721
|
+
@must.and_also(*queries)
|
722
|
+
self
|
723
|
+
end
|
724
|
+
|
725
|
+
# @param [*SearchQuery] queries
|
726
|
+
def must_not(*queries)
|
727
|
+
@must_not.or_else(*queries)
|
728
|
+
self
|
729
|
+
end
|
730
|
+
|
731
|
+
# @param [*SearchQuery] queries
|
732
|
+
def should(*queries)
|
733
|
+
@should.or_else(*queries)
|
734
|
+
self
|
735
|
+
end
|
736
|
+
|
737
|
+
# @return [String]
|
738
|
+
def to_json(*args)
|
739
|
+
if @must.empty? && @must_not.empty? && @should.empty?
|
740
|
+
raise ArgumentError, "BooleanQuery must have at least one non-empty sub-query"
|
741
|
+
end
|
742
|
+
data = {}
|
743
|
+
data["must"] = @must unless @must.empty?
|
744
|
+
data["must_not"] = @must_not unless @must_not.empty?
|
745
|
+
data["should"] = @should unless @should.empty?
|
746
|
+
data["boost"] = boost if boost
|
747
|
+
data.to_json(*args)
|
748
|
+
end
|
749
|
+
end
|
750
|
+
|
751
|
+
# Prepare {TermQuery} body
|
752
|
+
#
|
753
|
+
# @yieldparam [TermQuery] query
|
754
|
+
# @param [String] term
|
755
|
+
#
|
756
|
+
# @return [TermQuery]
|
757
|
+
def self.term(term, &block)
|
758
|
+
TermQuery.new(term, &block)
|
759
|
+
end
|
760
|
+
|
761
|
+
# A query that looks for **exact** matches of the term in the index (no analyzer, no stemming). Useful to check what the actual content of the index is. It can also apply fuzziness on the term. Usual better alternative is `MatchQuery`.
|
762
|
+
class TermQuery < SearchQuery
|
763
|
+
# @return [Float]
|
764
|
+
attr_accessor :boost
|
765
|
+
|
766
|
+
# @return [String]
|
767
|
+
attr_accessor :field
|
768
|
+
|
769
|
+
# @return [Integer]
|
770
|
+
attr_accessor :fuzziness
|
771
|
+
|
772
|
+
# @return [Integer]
|
773
|
+
attr_accessor :prefix_length
|
774
|
+
|
775
|
+
# @yieldparam [TermQuery] self
|
776
|
+
#
|
777
|
+
# @param [String] term
|
778
|
+
def initialize(term)
|
779
|
+
super()
|
780
|
+
@term = term
|
781
|
+
yield self if block_given?
|
782
|
+
end
|
783
|
+
|
784
|
+
# @return [String]
|
785
|
+
def to_json(*args)
|
786
|
+
data = {"term" => @term}
|
787
|
+
data["boost"] = boost if boost
|
788
|
+
data["field"] = field if field
|
789
|
+
if fuzziness
|
790
|
+
data["fuzziness"] = fuzziness
|
791
|
+
data["prefix_length"] = prefix_length if prefix_length
|
792
|
+
end
|
793
|
+
data.to_json(*args)
|
794
|
+
end
|
795
|
+
end
|
796
|
+
|
797
|
+
# Prepare {PrefixQuery} body
|
798
|
+
#
|
799
|
+
# @yieldparam [PrefixQuery] query
|
800
|
+
# @param [String] prefix
|
801
|
+
#
|
802
|
+
# @return [PrefixQuery]
|
803
|
+
def self.prefix(prefix, &block)
|
804
|
+
PrefixQuery.new(prefix, &block)
|
805
|
+
end
|
806
|
+
|
807
|
+
# The prefix query finds documents containing terms that start with the provided prefix. Usual better alternative is `MatchQuery`.
|
808
|
+
class PrefixQuery < SearchQuery
|
809
|
+
# @return [Float]
|
810
|
+
attr_accessor :boost
|
811
|
+
|
812
|
+
# @return [String]
|
813
|
+
attr_accessor :field
|
814
|
+
|
815
|
+
# @yieldparam [PrefixQuery] self
|
816
|
+
#
|
817
|
+
# @param [String] prefix
|
818
|
+
def initialize(prefix)
|
819
|
+
super()
|
820
|
+
@prefix = prefix
|
821
|
+
yield self if block_given?
|
822
|
+
end
|
823
|
+
|
824
|
+
# @return [String]
|
825
|
+
def to_json(*args)
|
826
|
+
data = {"prefix" => @prefix}
|
827
|
+
data["boost"] = boost if boost
|
828
|
+
data["field"] = field if field
|
829
|
+
data.to_json(*args)
|
830
|
+
end
|
831
|
+
end
|
832
|
+
|
833
|
+
# Prepare {PhraseQuery} body
|
834
|
+
#
|
835
|
+
# @yieldparam [PhraseQuery] query
|
836
|
+
# @param [*String] terms
|
837
|
+
#
|
838
|
+
# @return [PhraseQuery]
|
839
|
+
def self.phrase(*terms, &block)
|
840
|
+
PhraseQuery.new(*terms, &block)
|
841
|
+
end
|
842
|
+
|
843
|
+
# A query that looks for **exact** match of several terms (in the exact order) in the index. Usual better alternative is {MatchPhraseQuery}.
|
844
|
+
class PhraseQuery < SearchQuery
|
845
|
+
# @return [Float]
|
846
|
+
attr_accessor :boost
|
847
|
+
|
848
|
+
# @return [String]
|
849
|
+
attr_accessor :field
|
850
|
+
|
851
|
+
# @yieldparam [PhraseQuery] self
|
852
|
+
#
|
853
|
+
# @param [*String] terms
|
854
|
+
def initialize(*terms)
|
855
|
+
super()
|
856
|
+
@terms = terms.flatten
|
857
|
+
yield self if block_given?
|
858
|
+
end
|
859
|
+
|
860
|
+
# @return [String]
|
861
|
+
def to_json(*args)
|
862
|
+
data = {"terms" => @terms.flatten.uniq}
|
863
|
+
data["boost"] = boost if boost
|
864
|
+
data["field"] = field if field
|
865
|
+
data.to_json(*args)
|
866
|
+
end
|
867
|
+
end
|
868
|
+
|
869
|
+
# Prepare {MatchAllQuery} body
|
870
|
+
#
|
871
|
+
# @yieldparam [MatchAllQuery] query
|
872
|
+
#
|
873
|
+
# @return [MatchAllQuery]
|
874
|
+
def self.match_all(&block)
|
875
|
+
MatchAllQuery.new(&block)
|
876
|
+
end
|
877
|
+
|
878
|
+
# A query that matches all indexed documents.
|
879
|
+
class MatchAllQuery < SearchQuery
|
880
|
+
# @return [Float]
|
881
|
+
attr_accessor :boost
|
882
|
+
|
883
|
+
# @yieldparam [MatchAllQuery] self
|
884
|
+
def initialize
|
885
|
+
super()
|
886
|
+
yield self if block_given?
|
887
|
+
end
|
888
|
+
|
889
|
+
# @return [String]
|
890
|
+
def to_json(*args)
|
891
|
+
data = {"match_all" => nil}
|
892
|
+
data["boost"] = boost if boost
|
893
|
+
data.to_json(*args)
|
894
|
+
end
|
895
|
+
end
|
896
|
+
|
897
|
+
# Prepare {MatchNoneQuery} body
|
898
|
+
#
|
899
|
+
# @yieldparam [MatchNoneQuery] query
|
900
|
+
#
|
901
|
+
# @return [MatchNoneQuery]
|
902
|
+
def self.match_none(&block)
|
903
|
+
MatchNoneQuery.new(&block)
|
904
|
+
end
|
905
|
+
|
906
|
+
# A query that matches nothing.
|
907
|
+
class MatchNoneQuery < SearchQuery
|
908
|
+
# @return [Float]
|
909
|
+
attr_accessor :boost
|
910
|
+
|
911
|
+
# @yieldparam [MatchNoneQuery] self
|
912
|
+
def initialize
|
913
|
+
super()
|
914
|
+
yield self if block_given?
|
915
|
+
end
|
916
|
+
|
917
|
+
# @return [String]
|
918
|
+
def to_json(*args)
|
919
|
+
data = {"match_none" => nil}
|
920
|
+
data["boost"] = boost if boost
|
921
|
+
data.to_json(*args)
|
922
|
+
end
|
923
|
+
end
|
924
|
+
end
|
925
|
+
|
926
|
+
class SearchSort
|
927
|
+
# @yieldparam [SearchSortScore]
|
928
|
+
# @return [SearchSortScore]
|
929
|
+
def self.score(&block)
|
930
|
+
SearchSortScore.new(&block)
|
931
|
+
end
|
932
|
+
|
933
|
+
# @yieldparam [SearchSortId]
|
934
|
+
# @return [SearchSortScore]
|
935
|
+
def self.id(&block)
|
936
|
+
SearchSortId.new(&block)
|
937
|
+
end
|
938
|
+
|
939
|
+
# @param [String] name field name
|
940
|
+
# @yieldparam [SearchSortField]
|
941
|
+
# @return [SearchSortField]
|
942
|
+
def self.field(name, &block)
|
943
|
+
SearchSortField.new(name, &block)
|
944
|
+
end
|
945
|
+
|
946
|
+
# @param [String] name field name
|
947
|
+
# @param [Float] longitude
|
948
|
+
# @param [Float] latitude
|
949
|
+
# @yieldparam [SearchSortField]
|
950
|
+
# @return [SearchSortGeoDistance]
|
951
|
+
def self.geo_distance(name, longitude, latitude, &block)
|
952
|
+
SearchSortGeoDistance.new(name, longitude, latitude, &block)
|
953
|
+
end
|
954
|
+
|
955
|
+
class SearchSortScore < SearchSort
|
956
|
+
# @return [Boolean] if descending order should be applied
|
957
|
+
attr_accessor :desc
|
958
|
+
|
959
|
+
# @yieldparam [SearchSortScore]
|
960
|
+
def initialize
|
961
|
+
yield self if block_given?
|
962
|
+
end
|
963
|
+
|
964
|
+
# @api private
|
965
|
+
def to_json(*args)
|
966
|
+
{by: :score, desc: desc}.to_json(*args)
|
967
|
+
end
|
968
|
+
end
|
969
|
+
|
970
|
+
class SearchSortId < SearchSort
|
971
|
+
# @return [Boolean] if descending order should be applied
|
972
|
+
attr_accessor :desc
|
973
|
+
|
974
|
+
# @yieldparam [SearchSortId]
|
975
|
+
def initialize
|
976
|
+
yield self if block_given?
|
977
|
+
end
|
978
|
+
|
979
|
+
# @api private
|
980
|
+
def to_json(*args)
|
981
|
+
{by: :id, desc: desc}.to_json(*args)
|
982
|
+
end
|
983
|
+
end
|
984
|
+
|
985
|
+
class SearchSortField < SearchSort
|
986
|
+
# @return [String] name of the field to sort by
|
987
|
+
attr_reader :field
|
988
|
+
|
989
|
+
# @return [Boolean] if descending order should be applied
|
990
|
+
attr_accessor :desc
|
991
|
+
|
992
|
+
# @return [:auto, :string, :number, :date]
|
993
|
+
attr_accessor :type
|
994
|
+
|
995
|
+
# @return [:first, :last] where the documents with missing field should be placed
|
996
|
+
attr_accessor :missing
|
997
|
+
|
998
|
+
# @return [:default, :min, :max]
|
999
|
+
attr_accessor :mode
|
1000
|
+
|
1001
|
+
# @param [String] field the name of the filed for ordering
|
1002
|
+
# @yieldparam [SearchSortField]
|
1003
|
+
def initialize(field)
|
1004
|
+
@field = field
|
1005
|
+
yield self if block_given?
|
1006
|
+
end
|
1007
|
+
|
1008
|
+
# @api private
|
1009
|
+
def to_json(*args)
|
1010
|
+
{by: :field, field: field, desc: desc, type: type, missing: missing, mode: mode}.to_json(*args)
|
1011
|
+
end
|
1012
|
+
end
|
1013
|
+
|
1014
|
+
class SearchSortGeoDistance < SearchSort
|
1015
|
+
# @return [String] name of the field to sort by
|
1016
|
+
attr_reader :field
|
1017
|
+
|
1018
|
+
# @return [Boolean] if descending order should be applied
|
1019
|
+
attr_accessor :desc
|
1020
|
+
|
1021
|
+
# @return [Float]
|
1022
|
+
attr_reader :longitude
|
1023
|
+
|
1024
|
+
# @return [Float]
|
1025
|
+
attr_reader :latitude
|
1026
|
+
|
1027
|
+
# @return [:meters, :miles, :centimeters, :millimeters, :kilometers, :nauticalmiles, :feet, :yards, :inch]
|
1028
|
+
attr_accessor :unit
|
1029
|
+
|
1030
|
+
# @param [String] field field name
|
1031
|
+
# @param [Float] longitude
|
1032
|
+
# @param [Float] latitude
|
1033
|
+
# @yieldparam [SearchSortGeoDistance]
|
1034
|
+
def initialize(field, longitude, latitude)
|
1035
|
+
@field = field
|
1036
|
+
@longitude = longitude
|
1037
|
+
@latitude = latitude
|
1038
|
+
yield self if block_given?
|
1039
|
+
end
|
1040
|
+
|
1041
|
+
# @api private
|
1042
|
+
def to_json(*args)
|
1043
|
+
{by: :geo_distance, field: field, desc: desc, location: [longitude, latitude], unit: unit}.to_json(*args)
|
1044
|
+
end
|
1045
|
+
end
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
class SearchFacet
|
1049
|
+
# @param [String] field_name
|
1050
|
+
# @return [SearchFacetTerm]
|
1051
|
+
def self.term(field_name, &block)
|
1052
|
+
SearchFacetTerm.new(field_name, &block)
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
# @param [String] field_name
|
1056
|
+
# @return [SearchFacetNumericRange]
|
1057
|
+
def self.numeric_range(field_name, &block)
|
1058
|
+
SearchFacetNumericRange.new(field_name, &block)
|
1059
|
+
end
|
1060
|
+
|
1061
|
+
# @param [String] field_name
|
1062
|
+
# @return [SearchFacetDateRange]
|
1063
|
+
def self.date_range(field_name, &block)
|
1064
|
+
SearchFacetDateRange.new(field_name, &block)
|
1065
|
+
end
|
1066
|
+
|
1067
|
+
class SearchFacetTerm
|
1068
|
+
# @return [String]
|
1069
|
+
attr_reader :field
|
1070
|
+
|
1071
|
+
# @return [Integer]
|
1072
|
+
attr_accessor :size
|
1073
|
+
|
1074
|
+
# @param [String] field name of the field
|
1075
|
+
def initialize(field)
|
1076
|
+
@field = field
|
1077
|
+
yield self if block_given?
|
1078
|
+
end
|
1079
|
+
|
1080
|
+
# @api private
|
1081
|
+
def to_json(*args)
|
1082
|
+
{field: field, size: size}.to_json(*args)
|
1083
|
+
end
|
1084
|
+
end
|
1085
|
+
|
1086
|
+
class SearchFacetNumericRange
|
1087
|
+
# @return [String]
|
1088
|
+
attr_reader :field
|
1089
|
+
|
1090
|
+
# @return [Integer]
|
1091
|
+
attr_accessor :size
|
1092
|
+
|
1093
|
+
# @param [String] field name of the field
|
1094
|
+
def initialize(field)
|
1095
|
+
@field = field
|
1096
|
+
@ranges = []
|
1097
|
+
yield self if block_given?
|
1098
|
+
end
|
1099
|
+
|
1100
|
+
# @param [String] name the name of the range
|
1101
|
+
# @param [Integer, Float, nil] min lower bound of the range (pass +nil+ if there is no lower bound)
|
1102
|
+
# @param [Integer, Float, nil] max upper bound of the range (pass +nil+ if there is no upper bound)
|
1103
|
+
def add(name, min, max)
|
1104
|
+
@ranges.append({name: name, min: min, max: max})
|
1105
|
+
end
|
1106
|
+
|
1107
|
+
# @api private
|
1108
|
+
def to_json(*args)
|
1109
|
+
{field: field, size: size, numeric_ranges: @ranges}.to_json(*args)
|
1110
|
+
end
|
1111
|
+
end
|
1112
|
+
|
1113
|
+
class SearchFacetDateRange
|
1114
|
+
# @return [String]
|
1115
|
+
attr_reader :field
|
1116
|
+
|
1117
|
+
# @return [Integer]
|
1118
|
+
attr_accessor :size
|
1119
|
+
|
1120
|
+
# @param [String] field name of the field
|
1121
|
+
def initialize(field)
|
1122
|
+
@field = field
|
1123
|
+
@ranges = []
|
1124
|
+
yield self if block_given?
|
1125
|
+
end
|
1126
|
+
|
1127
|
+
DATE_FORMAT_RFC3339 = "%Y-%m-%dT%H:%M:%S%:z"
|
1128
|
+
|
1129
|
+
# @param [String] name the name of the range
|
1130
|
+
# @param [Time, String, nil] start_time lower bound of the range (pass +nil+ if there is no lower bound)
|
1131
|
+
# @param [Time, String, nil] end_time lower bound of the range (pass +nil+ if there is no lower bound)
|
1132
|
+
def add(name, start_time, end_time)
|
1133
|
+
start_time = start_time.strftime(DATE_FORMAT_RFC3339) if start_time && start_time.respond_to?(:strftime)
|
1134
|
+
end_time = end_time.strftime(DATE_FORMAT_RFC3339) if end_time && end_time.respond_to?(:strftime)
|
1135
|
+
@ranges.append({name: name, start: start_time, end: end_time})
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
# @api private
|
1139
|
+
def to_json(*args)
|
1140
|
+
{field: field, size: size, date_ranges: @ranges}.to_json(*args)
|
1141
|
+
end
|
1142
|
+
end
|
1143
|
+
end
|
1144
|
+
|
1145
|
+
class SearchOptions
|
1146
|
+
# @return [Integer] Timeout in milliseconds
|
1147
|
+
attr_accessor :timeout
|
1148
|
+
|
1149
|
+
# @return [Integer] limits the number of matches returned from the complete result set.
|
1150
|
+
attr_accessor :limit
|
1151
|
+
|
1152
|
+
# @return [Integer] indicates how many matches are skipped on the result set before starting to return the matches
|
1153
|
+
attr_accessor :skip
|
1154
|
+
|
1155
|
+
# @return [Boolean] triggers inclusion of additional search result score explanations. (Default: +false+)
|
1156
|
+
attr_accessor :explain
|
1157
|
+
|
1158
|
+
# @return [:html, :ansi] the style of highlighting in the result excerpts (if not specified, the server default will be used)
|
1159
|
+
attr_accessor :highlight_style
|
1160
|
+
|
1161
|
+
# @return [Array<String>] list of the fields to highlight
|
1162
|
+
attr_accessor :highlight_fields
|
1163
|
+
|
1164
|
+
# @return [Array<String>] list of field values which should be retrieved for result documents, provided they were stored while indexing
|
1165
|
+
attr_accessor :fields
|
1166
|
+
|
1167
|
+
# @return [:not_bounded] specifies level of consistency for the query
|
1168
|
+
attr_reader :scan_consistency
|
1169
|
+
|
1170
|
+
# @api private
|
1171
|
+
# @return [MutationState]
|
1172
|
+
attr_reader :mutation_state
|
1173
|
+
|
1174
|
+
# Customizes the consistency guarantees for this query
|
1175
|
+
#
|
1176
|
+
# @note overrides consistency level set by {#consistent_with}
|
1177
|
+
#
|
1178
|
+
# [+:not_bounded+] The engine will return whatever state it has at the time of query
|
1179
|
+
#
|
1180
|
+
# @param [:not_bounded] level the scan consistency to be used for this query
|
1181
|
+
#
|
1182
|
+
# @return [void]
|
1183
|
+
def scan_consistency=(level)
|
1184
|
+
@mutation_state = nil if @mutation_state
|
1185
|
+
@scan_consistency = level
|
1186
|
+
end
|
1187
|
+
|
1188
|
+
# Sets the mutation tokens this query should be consistent with
|
1189
|
+
#
|
1190
|
+
# @note overrides consistency level set by {#scan_consistency=}
|
1191
|
+
#
|
1192
|
+
# @param [MutationState] mutation_state the mutation state containing the mutation tokens
|
1193
|
+
#
|
1194
|
+
# @return [void]
|
1195
|
+
def consistent_with(mutation_state)
|
1196
|
+
@scan_consistency = nil if @scan_consistency
|
1197
|
+
@mutation_state = mutation_state
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
# Ordering rules to apply to the results
|
1201
|
+
#
|
1202
|
+
# The list might contain either strings or special objects, that derive from {SearchSort}.
|
1203
|
+
#
|
1204
|
+
# In case of String, the value represents the name of the field with optional +-+ in front of the name, which will turn on descending mode for this field. One field is special is +"_score"+ which will sort results by their score.
|
1205
|
+
#
|
1206
|
+
# When nothing specified, the Server will order results by their score descending, which is equivalent of +"-_score"+.
|
1207
|
+
#
|
1208
|
+
# @return [Array<String, SearchSort>] list of ordering object
|
1209
|
+
attr_accessor :sort
|
1210
|
+
|
1211
|
+
# Facets allow to aggregate information collected on a particular result set
|
1212
|
+
#
|
1213
|
+
# @return [Hash<String => SearchFacet>]
|
1214
|
+
attr_accessor :facets
|
1215
|
+
|
1216
|
+
# @return [JsonTranscoder] transcoder to use for the results
|
1217
|
+
attr_accessor :transcoder
|
1218
|
+
|
1219
|
+
# @yieldparam [SearchOptions] self
|
1220
|
+
def initialize
|
1221
|
+
@explain = false
|
1222
|
+
@transcoder = JsonTranscoder.new
|
1223
|
+
@scan_consistency = nil
|
1224
|
+
@mutation_state = nil
|
1225
|
+
yield self if block_given?
|
1226
|
+
end
|
1227
|
+
end
|
1228
|
+
|
1229
|
+
class SearchRowLocation
|
1230
|
+
# @return [String]
|
1231
|
+
attr_accessor :field
|
1232
|
+
|
1233
|
+
# @return [String]
|
1234
|
+
attr_accessor :term
|
1235
|
+
|
1236
|
+
# @return [Integer] the position of the term within the field, starting at 1
|
1237
|
+
attr_accessor :position
|
1238
|
+
|
1239
|
+
# @return [Integer] start byte offset of the term in the field
|
1240
|
+
attr_accessor :start_offset
|
1241
|
+
|
1242
|
+
# @return [Integer] end byte offset of the term in the field
|
1243
|
+
attr_accessor :end_offset
|
1244
|
+
|
1245
|
+
# @return [Array<Integer>] the positions of the term within any elements.
|
1246
|
+
attr_accessor :array_positions
|
1247
|
+
end
|
1248
|
+
|
1249
|
+
class SearchRowLocations
|
1250
|
+
# Lists all locations (any field, any term)
|
1251
|
+
#
|
1252
|
+
# @return [Array<SearchRowLocation>]
|
1253
|
+
def get_all
|
1254
|
+
@locations
|
1255
|
+
end
|
1256
|
+
|
1257
|
+
# Lists all locations for a given field (any term)
|
1258
|
+
#
|
1259
|
+
# @return [Array<SearchRowLocation>]
|
1260
|
+
def get_for_field(name)
|
1261
|
+
@locations.select { |location| location.field == name }
|
1262
|
+
end
|
1263
|
+
|
1264
|
+
# Lists all locations for a given field and term
|
1265
|
+
#
|
1266
|
+
# @return [Array<SearchRowLocation>]
|
1267
|
+
def get_for_field_and_term(name, term)
|
1268
|
+
@locations.select { |location| location.field == name && location.term == term }
|
1269
|
+
end
|
1270
|
+
|
1271
|
+
# Lists the fields in this location
|
1272
|
+
#
|
1273
|
+
# @return [Array<String>]
|
1274
|
+
def fields
|
1275
|
+
@locations.map { |location| location.field }.uniq
|
1276
|
+
end
|
1277
|
+
|
1278
|
+
# Lists all terms in this locations, considering all fields
|
1279
|
+
#
|
1280
|
+
# @return [Array<String>]
|
1281
|
+
def terms
|
1282
|
+
@locations.map { |location| location.term }.uniq
|
1283
|
+
end
|
1284
|
+
|
1285
|
+
# Lists the terms for a given field
|
1286
|
+
#
|
1287
|
+
# @return [Array<String>]
|
1288
|
+
def terms_for_field(name)
|
1289
|
+
get_for_field(name).map { |location| location.term }.uniq
|
1290
|
+
end
|
1291
|
+
|
1292
|
+
# @param [Array<SearchRowLocation>] locations
|
1293
|
+
def initialize(locations)
|
1294
|
+
@locations = locations
|
1295
|
+
end
|
1296
|
+
end
|
1297
|
+
|
1298
|
+
# An individual facet result has both metadata and details, as each facet can define ranges into which results are
|
1299
|
+
# categorized
|
1300
|
+
class SearchFacetResult
|
1301
|
+
# @return [String]
|
1302
|
+
attr_accessor :name
|
1303
|
+
|
1304
|
+
# @return [String]
|
1305
|
+
attr_accessor :field
|
1306
|
+
|
1307
|
+
# @return [Integer]
|
1308
|
+
attr_accessor :total
|
1309
|
+
|
1310
|
+
# @return [Integer]
|
1311
|
+
attr_accessor :missing
|
1312
|
+
|
1313
|
+
# @return [Integer]
|
1314
|
+
attr_accessor :other
|
1315
|
+
|
1316
|
+
class TermFacetResult < SearchFacetResult
|
1317
|
+
# @return [Array<TermFacet>]
|
1318
|
+
attr_accessor :terms
|
1319
|
+
|
1320
|
+
def type
|
1321
|
+
:term_facet
|
1322
|
+
end
|
1323
|
+
|
1324
|
+
# @yieldparam [TermFacetResult] self
|
1325
|
+
def initialize
|
1326
|
+
yield self if block_given?
|
1327
|
+
end
|
1328
|
+
|
1329
|
+
class TermFacet
|
1330
|
+
# @return [String]
|
1331
|
+
attr_reader :term
|
1332
|
+
|
1333
|
+
# @return [Integer]
|
1334
|
+
attr_reader :count
|
1335
|
+
|
1336
|
+
def initialize(term, count)
|
1337
|
+
@term = term
|
1338
|
+
@count = count
|
1339
|
+
end
|
1340
|
+
end
|
1341
|
+
end
|
1342
|
+
|
1343
|
+
class DateRangeFacetResult < SearchFacetResult
|
1344
|
+
# @return [Array<DateRangeFacet>]
|
1345
|
+
attr_accessor :date_ranges
|
1346
|
+
|
1347
|
+
def type
|
1348
|
+
:date_range_facet
|
1349
|
+
end
|
1350
|
+
|
1351
|
+
# @yieldparam [DateRangeFacetResult] self
|
1352
|
+
def initialize
|
1353
|
+
yield self if block_given?
|
1354
|
+
end
|
1355
|
+
|
1356
|
+
class DateRangeFacet
|
1357
|
+
# @return [String]
|
1358
|
+
attr_reader :name
|
1359
|
+
|
1360
|
+
# @return [Integer]
|
1361
|
+
attr_reader :count
|
1362
|
+
|
1363
|
+
# @return [String]
|
1364
|
+
attr_reader :start_time
|
1365
|
+
|
1366
|
+
# @return [String]
|
1367
|
+
attr_reader :end_time
|
1368
|
+
|
1369
|
+
def initialize(name, count, start_time, end_time)
|
1370
|
+
@name = name
|
1371
|
+
@count = count
|
1372
|
+
@start_time = start_time
|
1373
|
+
@end_time = end_time
|
1374
|
+
end
|
1375
|
+
end
|
1376
|
+
end
|
1377
|
+
|
1378
|
+
class NumericRangeFacetResult < SearchFacetResult
|
1379
|
+
# @return [Array<NumericRangeFacet>]
|
1380
|
+
attr_accessor :numeric_ranges
|
1381
|
+
|
1382
|
+
def type
|
1383
|
+
:numeric_range_facet
|
1384
|
+
end
|
1385
|
+
|
1386
|
+
# @yieldparam [NumericRangeFacetResult] self
|
1387
|
+
def initialize
|
1388
|
+
yield self if block_given?
|
1389
|
+
end
|
1390
|
+
|
1391
|
+
class NumericRangeFacet
|
1392
|
+
# @return [String]
|
1393
|
+
attr_reader :name
|
1394
|
+
|
1395
|
+
# @return [Integer]
|
1396
|
+
attr_reader :count
|
1397
|
+
|
1398
|
+
# @return [Integer, Float, nil]
|
1399
|
+
attr_reader :min
|
1400
|
+
|
1401
|
+
# @return [Integer, Float, nil]
|
1402
|
+
attr_reader :max
|
1403
|
+
|
1404
|
+
def initialize(name, count, min, max)
|
1405
|
+
@name = name
|
1406
|
+
@count = count
|
1407
|
+
@min = min
|
1408
|
+
@max = max
|
1409
|
+
end
|
1410
|
+
end
|
1411
|
+
end
|
1412
|
+
end
|
1413
|
+
|
1414
|
+
class SearchRow
|
1415
|
+
# @return [String] name of the index
|
1416
|
+
attr_accessor :index
|
1417
|
+
|
1418
|
+
# @return [String] document identifier
|
1419
|
+
attr_accessor :id
|
1420
|
+
|
1421
|
+
# @return [Float]
|
1422
|
+
attr_accessor :score
|
1423
|
+
|
1424
|
+
# @return [SearchRowLocations]
|
1425
|
+
attr_accessor :locations
|
1426
|
+
|
1427
|
+
# @return [Hash]
|
1428
|
+
attr_accessor :explanation
|
1429
|
+
|
1430
|
+
# @return [Hash<String => Array<String>>]
|
1431
|
+
attr_accessor :fragments
|
1432
|
+
|
1433
|
+
# @return [JsonTranscoder] transcoder to use for the fields
|
1434
|
+
attr_accessor :transcoder
|
1435
|
+
|
1436
|
+
def fields
|
1437
|
+
@transcoder.decode(@fields, :json) if @fields && @transcoder
|
1438
|
+
end
|
1439
|
+
|
1440
|
+
# @yieldparam [SearchRow] self
|
1441
|
+
def initialize
|
1442
|
+
@fields = nil
|
1443
|
+
yield self if block_given?
|
1444
|
+
end
|
1445
|
+
end
|
1446
|
+
|
1447
|
+
class SearchMetrics
|
1448
|
+
# @return [Integer] time spent executing the query (in milliseconds)
|
1449
|
+
attr_accessor :took
|
1450
|
+
|
1451
|
+
# @return [Integer]
|
1452
|
+
attr_accessor :total_rows
|
1453
|
+
|
1454
|
+
# @return [Float]
|
1455
|
+
attr_accessor :max_score
|
1456
|
+
|
1457
|
+
# @return [Integer]
|
1458
|
+
attr_accessor :success_partition_count
|
1459
|
+
|
1460
|
+
# @return [Integer]
|
1461
|
+
attr_accessor :error_partition_count
|
1462
|
+
|
1463
|
+
# @return [Integer]
|
1464
|
+
def total_partition_count
|
1465
|
+
success_partition_count + error_partition_count
|
1466
|
+
end
|
1467
|
+
end
|
1468
|
+
|
1469
|
+
class SearchMetaData
|
1470
|
+
# @return [SearchMetrics]
|
1471
|
+
attr_accessor :metrics
|
1472
|
+
|
1473
|
+
# @return [Hash<String => String>]
|
1474
|
+
attr_accessor :errors
|
1475
|
+
|
1476
|
+
# @yieldparam [SearchMetaData] self
|
1477
|
+
def initialize
|
1478
|
+
@metrics = SearchMetrics.new
|
1479
|
+
yield self if block_given?
|
1480
|
+
end
|
1481
|
+
end
|
1482
|
+
|
1483
|
+
class SearchResult
|
1484
|
+
# @return [Array<SearchRow>]
|
1485
|
+
attr_accessor :rows
|
1486
|
+
|
1487
|
+
# @return [Hash<String => SearchFacetResult>]
|
1488
|
+
attr_accessor :facets
|
1489
|
+
|
1490
|
+
# @return [SearchMetaData]
|
1491
|
+
attr_accessor :meta_data
|
1492
|
+
|
1493
|
+
# @yieldparam [SearchResult] self
|
1494
|
+
def initialize
|
1495
|
+
yield self if block_given?
|
1496
|
+
end
|
1497
|
+
end
|
1498
|
+
end
|
1499
|
+
end
|