elasticsearch-api 6.8.3 → 7.0.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +17 -1
- data/LICENSE.txt +199 -10
- data/README.md +3 -3
- data/Rakefile +23 -6
- data/elasticsearch-api.gemspec +77 -43
- data/lib/elasticsearch-api.rb +16 -3
- data/lib/elasticsearch/api.rb +18 -5
- data/lib/elasticsearch/api/actions/abort_benchmark.rb +17 -4
- data/lib/elasticsearch/api/actions/benchmark.rb +18 -5
- data/lib/elasticsearch/api/actions/bulk.rb +18 -7
- data/lib/elasticsearch/api/actions/cat/aliases.rb +25 -11
- data/lib/elasticsearch/api/actions/cat/allocation.rb +26 -12
- data/lib/elasticsearch/api/actions/cat/count.rb +25 -11
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +23 -11
- data/lib/elasticsearch/api/actions/cat/health.rb +26 -12
- data/lib/elasticsearch/api/actions/cat/help.rb +18 -6
- data/lib/elasticsearch/api/actions/cat/indices.rb +28 -13
- data/lib/elasticsearch/api/actions/cat/master.rb +25 -11
- data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +19 -7
- data/lib/elasticsearch/api/actions/cat/nodes.rb +25 -11
- data/lib/elasticsearch/api/actions/cat/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +25 -11
- data/lib/elasticsearch/api/actions/cat/plugins.rb +21 -8
- data/lib/elasticsearch/api/actions/cat/recovery.rb +26 -11
- data/lib/elasticsearch/api/actions/cat/repositories.rb +18 -7
- data/lib/elasticsearch/api/actions/cat/segments.rb +22 -10
- data/lib/elasticsearch/api/actions/cat/shards.rb +26 -12
- data/lib/elasticsearch/api/actions/cat/snapshots.rb +19 -9
- data/lib/elasticsearch/api/actions/cat/tasks.rb +20 -6
- data/lib/elasticsearch/api/actions/cat/templates.rb +21 -8
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +33 -16
- data/lib/elasticsearch/api/actions/clear_scroll.rb +19 -15
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +20 -6
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +19 -7
- data/lib/elasticsearch/api/actions/cluster/health.rb +35 -13
- data/lib/elasticsearch/api/actions/cluster/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +20 -6
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +19 -8
- data/lib/elasticsearch/api/actions/cluster/remote_info.rb +17 -10
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +23 -10
- data/lib/elasticsearch/api/actions/cluster/state.rb +28 -18
- data/lib/elasticsearch/api/actions/cluster/stats.rb +21 -16
- data/lib/elasticsearch/api/actions/count.rb +18 -4
- data/lib/elasticsearch/api/actions/create.rb +16 -3
- data/lib/elasticsearch/api/actions/delete.rb +24 -19
- data/lib/elasticsearch/api/actions/delete_by_query.rb +18 -5
- data/lib/elasticsearch/api/actions/{delete_by_query_rethrottle.rb → delete_by_rethrottle.rb} +18 -5
- data/lib/elasticsearch/api/actions/delete_script.rb +18 -5
- data/lib/elasticsearch/api/actions/exists.rb +18 -6
- data/lib/elasticsearch/api/actions/exists_source.rb +16 -3
- data/lib/elasticsearch/api/actions/explain.rb +30 -10
- data/lib/elasticsearch/api/actions/field_caps.rb +18 -6
- data/lib/elasticsearch/api/actions/get.rb +20 -6
- data/lib/elasticsearch/api/actions/get_script.rb +22 -9
- data/lib/elasticsearch/api/actions/get_source.rb +32 -10
- data/lib/elasticsearch/api/actions/index.rb +37 -17
- data/lib/elasticsearch/api/actions/indices/analyze.rb +32 -6
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +20 -8
- data/lib/elasticsearch/api/actions/indices/close.rb +31 -11
- data/lib/elasticsearch/api/actions/indices/create.rb +36 -24
- data/lib/elasticsearch/api/actions/indices/delete.rb +21 -7
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +20 -8
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +18 -6
- data/lib/elasticsearch/api/actions/indices/exists.rb +32 -12
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +30 -10
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +20 -8
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +31 -10
- data/lib/elasticsearch/api/actions/indices/flush.rb +26 -9
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/forcemerge.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/freeze.rb +1 -4
- data/lib/elasticsearch/api/actions/indices/get.rb +21 -7
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +21 -7
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +21 -8
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/get_template.rb +21 -7
- data/lib/elasticsearch/api/actions/indices/open.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +23 -11
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/put_template.rb +21 -7
- data/lib/elasticsearch/api/actions/indices/recovery.rb +19 -6
- data/lib/elasticsearch/api/actions/indices/refresh.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/rollover.rb +21 -7
- data/lib/elasticsearch/api/actions/indices/segments.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/shard_stores.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/shrink.rb +18 -7
- data/lib/elasticsearch/api/actions/indices/split.rb +19 -9
- data/lib/elasticsearch/api/actions/indices/stats.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/unfreeze.rb +0 -4
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +18 -5
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +18 -5
- data/lib/elasticsearch/api/actions/info.rb +16 -9
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +18 -5
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +20 -8
- data/lib/elasticsearch/api/actions/ingest/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +0 -4
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +18 -5
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +22 -9
- data/lib/elasticsearch/api/actions/mget.rb +17 -4
- data/lib/elasticsearch/api/actions/msearch.rb +21 -7
- data/lib/elasticsearch/api/actions/msearch_template.rb +21 -6
- data/lib/elasticsearch/api/actions/mtermvectors.rb +18 -5
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +20 -5
- data/lib/elasticsearch/api/actions/nodes/info.rb +44 -11
- data/lib/elasticsearch/api/actions/nodes/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +19 -12
- data/lib/elasticsearch/api/actions/nodes/shutdown.rb +17 -4
- data/lib/elasticsearch/api/actions/nodes/stats.rb +18 -5
- data/lib/elasticsearch/api/actions/nodes/usage.rb +3 -7
- data/lib/elasticsearch/api/actions/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/ping.rb +16 -9
- data/lib/elasticsearch/api/actions/put_script.rb +18 -6
- data/lib/elasticsearch/api/actions/rank_eval.rb +17 -4
- data/lib/elasticsearch/api/actions/reindex.rb +19 -5
- data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +17 -4
- data/lib/elasticsearch/api/actions/remote/info.rb +16 -3
- data/lib/elasticsearch/api/actions/render_search_template.rb +18 -5
- data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +16 -9
- data/lib/elasticsearch/api/actions/scroll.rb +19 -6
- data/lib/elasticsearch/api/actions/search.rb +72 -39
- data/lib/elasticsearch/api/actions/search_shards.rb +31 -11
- data/lib/elasticsearch/api/actions/search_template.rb +21 -6
- data/lib/elasticsearch/api/actions/snapshot/create.rb +20 -6
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +18 -5
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +20 -7
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +19 -5
- data/lib/elasticsearch/api/actions/snapshot/get.rb +21 -7
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +23 -7
- data/lib/elasticsearch/api/actions/snapshot/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +18 -5
- data/lib/elasticsearch/api/actions/snapshot/status.rb +23 -8
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +18 -5
- data/lib/elasticsearch/api/actions/tasks/cancel.rb +18 -5
- data/lib/elasticsearch/api/actions/tasks/get.rb +18 -5
- data/lib/elasticsearch/api/actions/tasks/list.rb +18 -5
- data/lib/elasticsearch/api/actions/tasks/params_registry.rb +19 -6
- data/lib/elasticsearch/api/actions/termvectors.rb +33 -18
- data/lib/elasticsearch/api/actions/update.rb +61 -26
- data/lib/elasticsearch/api/actions/update_by_query.rb +18 -5
- data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +16 -3
- data/lib/elasticsearch/api/namespace/cat.rb +16 -3
- data/lib/elasticsearch/api/namespace/cluster.rb +16 -3
- data/lib/elasticsearch/api/namespace/common.rb +16 -3
- data/lib/elasticsearch/api/namespace/indices.rb +16 -3
- data/lib/elasticsearch/api/namespace/ingest.rb +16 -3
- data/lib/elasticsearch/api/namespace/nodes.rb +16 -3
- data/lib/elasticsearch/api/namespace/remote.rb +16 -3
- data/lib/elasticsearch/api/namespace/snapshot.rb +16 -3
- data/lib/elasticsearch/api/namespace/tasks.rb +16 -3
- data/lib/elasticsearch/api/utils.rb +16 -3
- data/lib/elasticsearch/api/version.rb +17 -4
- data/spec/elasticsearch/api/actions/abort_benchmark_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/benchmark_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/bulk_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/aliases_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/allocation_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/count_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/fielddata_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/health_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/help_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/indices_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/master_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/nodeattrs_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/nodes_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/pending_tasks_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/plugins_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/recovery_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/repositories_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/segments_spec.rb +33 -4
- data/spec/elasticsearch/api/actions/cat/shards_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/snapshot_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/tasks_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/templates_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cat/thread_pool_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/clear_scroll_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/allocation_explain_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/get_settings_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/health_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/pending_tasks_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/remote_info_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/reroute_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/state_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +16 -20
- data/spec/elasticsearch/api/actions/count_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/create_document_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/delete_document_spec.rb +16 -9
- data/spec/elasticsearch/api/actions/delete_script_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/exists_document_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/explain_document_spec.rb +17 -10
- data/spec/elasticsearch/api/actions/field_caps_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/get_document_source_spec.rb +17 -4
- data/spec/elasticsearch/api/actions/get_document_spec.rb +17 -4
- data/spec/elasticsearch/api/actions/get_script_spec.rb +22 -16
- data/spec/elasticsearch/api/actions/hashie_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/index_document_spec.rb +16 -9
- data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +19 -6
- data/spec/elasticsearch/api/actions/indices/close_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/create_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/delete_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/delete_template_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/exists_alias_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/exists_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/exists_template_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/exists_type_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/flush_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/flush_synced_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/forcemerge_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +68 -0
- data/spec/elasticsearch/api/actions/indices/get_alias_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/get_field_mapping_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/get_mapping_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/get_settings_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/get_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/open_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +31 -3
- data/spec/elasticsearch/api/actions/indices/put_template_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/recovery_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/rollover_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/segments_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/shard_stores_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/shrink_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/split_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/stats_spec.rb +125 -0
- data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +68 -0
- data/spec/elasticsearch/api/actions/indices/update_aliases_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/upgrade_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/info_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/ingest/delete_pipeline_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/ingest/get_pipeline_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/ingest/put_pipeline_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/ingest/simulate_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/json_builders_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/mget_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/msearch_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/msearch_template_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/mtermvectors_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/nodes/info_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/nodes/reload_secure_settings_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/nodes/stats_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/ping_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/put_script_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/reindex_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/remote/info_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/render_search_template_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/scoll_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/search_shards_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/search_spec.rb +31 -3
- data/spec/elasticsearch/api/actions/search_template_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/create_repository_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/create_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/delete_repository_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/delete_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/get_repository_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/get_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/restore_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/status_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/snapshot/verify_repository_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/tasks/cancel_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/tasks/get_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/tasks/list_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/termvectors_spec.rb +16 -9
- data/spec/elasticsearch/api/actions/update_by_query_spec.rb +16 -3
- data/spec/elasticsearch/api/actions/update_document_spec.rb +16 -9
- data/spec/elasticsearch/api/api_spec.rb +16 -3
- data/spec/elasticsearch/api/client_spec.rb +16 -3
- data/spec/elasticsearch/api/utils_spec.rb +16 -3
- data/spec/spec_helper.rb +16 -14
- data/test/integration/yaml_test_runner.rb +84 -42
- data/test/test_helper.rb +86 -14
- data/utils/Gemfile +17 -0
- data/utils/Thorfile +17 -0
- data/utils/thor/generate_api.rb +16 -3
- data/utils/thor/generate_source.rb +22 -6
- data/utils/thor/lister.rb +16 -3
- data/utils/thor/templates/ruby/method.erb +22 -7
- data/utils/thor/templates/ruby/test.erb +17 -0
- data/utils/thor/templates/ruby/test_helper.rb +16 -4
- metadata +56 -122
- data/lib/elasticsearch/api/actions/count_percolate.rb +0 -86
- data/lib/elasticsearch/api/actions/delete_template.rb +0 -25
- data/lib/elasticsearch/api/actions/field_stats.rb +0 -40
- data/lib/elasticsearch/api/actions/get_template.rb +0 -31
- data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +0 -30
- data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +0 -36
- data/lib/elasticsearch/api/actions/indices/get_aliases.rb +0 -41
- data/lib/elasticsearch/api/actions/indices/get_warmer.rb +0 -66
- data/lib/elasticsearch/api/actions/indices/optimize.rb +0 -81
- data/lib/elasticsearch/api/actions/indices/put_warmer.rb +0 -69
- data/lib/elasticsearch/api/actions/indices/seal.rb +0 -28
- data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +0 -48
- data/lib/elasticsearch/api/actions/indices/status.rb +0 -67
- data/lib/elasticsearch/api/actions/list_benchmarks.rb +0 -31
- data/lib/elasticsearch/api/actions/mlt.rb +0 -134
- data/lib/elasticsearch/api/actions/mpercolate.rb +0 -66
- data/lib/elasticsearch/api/actions/percolate.rb +0 -77
- data/lib/elasticsearch/api/actions/put_template.rb +0 -29
- data/lib/elasticsearch/api/actions/search_exists.rb +0 -67
- data/lib/elasticsearch/api/actions/suggest.rb +0 -53
- data/spec/elasticsearch/api/actions/count_percolate_spec.rb +0 -21
- data/spec/elasticsearch/api/actions/delete_template_spec.rb +0 -21
- data/spec/elasticsearch/api/actions/field_stats_spec.rb +0 -21
- data/spec/elasticsearch/api/actions/get_template_spec.rb +0 -56
- data/spec/elasticsearch/api/actions/indices/delete_mapping_spec.rb +0 -81
- data/spec/elasticsearch/api/actions/indices/delete_warmer_spec.rb +0 -90
- data/spec/elasticsearch/api/actions/indices/get_aliases_spec.rb +0 -59
- data/spec/elasticsearch/api/actions/indices/get_template_spec.rb +0 -63
- data/spec/elasticsearch/api/actions/indices/get_warmer_spec.rb +0 -52
- data/spec/elasticsearch/api/actions/indices/optimize_spec.rb +0 -67
- data/spec/elasticsearch/api/actions/indices/put_warmer_spec.rb +0 -105
- data/spec/elasticsearch/api/actions/indices/seal_spec.rb +0 -22
- data/spec/elasticsearch/api/actions/indices/snapshot_index_spec.rb +0 -93
- data/spec/elasticsearch/api/actions/indices/status_spec.rb +0 -96
- data/spec/elasticsearch/api/actions/list_benchmarks_spec.rb +0 -21
- data/spec/elasticsearch/api/actions/mlt_spec.rb +0 -134
- data/spec/elasticsearch/api/actions/mpercolate_spec.rb +0 -53
- data/spec/elasticsearch/api/actions/put_template_spec.rb +0 -21
- data/spec/elasticsearch/api/actions/rank_eval_spec.rb +0 -113
- data/spec/elasticsearch/api/actions/search_exists_spec.rb +0 -67
- data/spec/elasticsearch/api/actions/suggest_spec.rb +0 -81
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
module Elasticsearch
|
|
6
|
-
module API
|
|
7
|
-
module Actions
|
|
8
|
-
|
|
9
|
-
# Return names of queries matching a document.
|
|
10
|
-
#
|
|
11
|
-
# Percolator allows you to register queries and then evaluate a document against them:
|
|
12
|
-
# the IDs of matching queries are returned in the response.
|
|
13
|
-
#
|
|
14
|
-
# @deprecated The `_percolate` API has been deprecated in favour of a special field mapping and the
|
|
15
|
-
# `percolate` query;
|
|
16
|
-
# see https://www.elastic.co/guide/en/elasticsearch/reference/5.5/breaking_50_percolator.html
|
|
17
|
-
#
|
|
18
|
-
# See full example for Elasticsearch 5.x and higher in <https://github.com/elastic/elasticsearch-ruby/blob/master/examples/percolator/percolator_alerts.rb>
|
|
19
|
-
#
|
|
20
|
-
# @option arguments [String] :index The index of the document being percolated. (*Required*)
|
|
21
|
-
# @option arguments [String] :type The type of the document being percolated. (*Required*)
|
|
22
|
-
# @option arguments [String] :id Fetch the document specified by index/type/id and
|
|
23
|
-
# use it instead of the passed `doc`
|
|
24
|
-
# @option arguments [Hash] :body The percolator request definition using the percolate DSL
|
|
25
|
-
# @option arguments [List] :routing A comma-separated list of specific routing values
|
|
26
|
-
# @option arguments [String] :preference Specify the node or shard the operation should be performed on
|
|
27
|
-
# (default: random)
|
|
28
|
-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
|
|
29
|
-
# unavailable (missing or closed)
|
|
30
|
-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
|
|
31
|
-
# no concrete indices. (This includes `_all` string or when no
|
|
32
|
-
# indices have been specified)
|
|
33
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are
|
|
34
|
-
# open, closed or both. (options: open, closed)
|
|
35
|
-
# @option arguments [String] :percolate_index The index to percolate the document into. Defaults to passed `index`.
|
|
36
|
-
# @option arguments [String] :percolate_format Return an array of matching query IDs instead of objects.
|
|
37
|
-
# (options: ids)
|
|
38
|
-
# @option arguments [String] :percolate_type The type to percolate document into. Defaults to passed `type`.
|
|
39
|
-
# @option arguments [Number] :version Explicit version number for concurrency control
|
|
40
|
-
# @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
|
|
41
|
-
#
|
|
42
|
-
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-percolate.html
|
|
43
|
-
#
|
|
44
|
-
def percolate(arguments={})
|
|
45
|
-
Utils.__report_unsupported_method :percolate
|
|
46
|
-
|
|
47
|
-
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
|
48
|
-
raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
|
|
49
|
-
method = HTTP_GET
|
|
50
|
-
path = Utils.__pathify Utils.__escape(arguments[:index]),
|
|
51
|
-
Utils.__escape(arguments[:type]),
|
|
52
|
-
Utils.__escape(arguments[:id]),
|
|
53
|
-
'_percolate'
|
|
54
|
-
|
|
55
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
56
|
-
body = arguments[:body]
|
|
57
|
-
|
|
58
|
-
perform_request(method, path, params, body).body
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
# Register this action with its valid params when the module is loaded.
|
|
62
|
-
#
|
|
63
|
-
# @since 6.2.0
|
|
64
|
-
ParamsRegistry.register(:percolate, [
|
|
65
|
-
:routing,
|
|
66
|
-
:preference,
|
|
67
|
-
:ignore_unavailable,
|
|
68
|
-
:allow_no_indices,
|
|
69
|
-
:expand_wildcards,
|
|
70
|
-
:percolate_index,
|
|
71
|
-
:percolate_type,
|
|
72
|
-
:percolate_format,
|
|
73
|
-
:version,
|
|
74
|
-
:version_type ].freeze)
|
|
75
|
-
end
|
|
76
|
-
end
|
|
77
|
-
end
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
module Elasticsearch
|
|
6
|
-
module API
|
|
7
|
-
module Actions
|
|
8
|
-
|
|
9
|
-
# Store a template for the search definition in Elasticsearch,
|
|
10
|
-
# to be later used with the `search_template` method
|
|
11
|
-
#
|
|
12
|
-
# @option arguments [String] :id Template ID (*Required*)
|
|
13
|
-
# @option arguments [Hash] :body The document (*Required*)
|
|
14
|
-
#
|
|
15
|
-
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
|
|
16
|
-
#
|
|
17
|
-
def put_template(arguments={})
|
|
18
|
-
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
|
19
|
-
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
|
20
|
-
method = HTTP_POST
|
|
21
|
-
path = "_scripts/#{arguments[:id]}"
|
|
22
|
-
params = {}
|
|
23
|
-
body = arguments[:body]
|
|
24
|
-
|
|
25
|
-
perform_request(method, path, params, body).body
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
module Elasticsearch
|
|
6
|
-
module API
|
|
7
|
-
module Actions
|
|
8
|
-
|
|
9
|
-
# Return whether documents exists for a particular query
|
|
10
|
-
#
|
|
11
|
-
# @option arguments [List] :index A comma-separated list of indices to restrict the results
|
|
12
|
-
# @option arguments [List] :type A comma-separated list of types to restrict the results
|
|
13
|
-
# @option arguments [Hash] :body A query to restrict the results specified with the Query DSL (optional)
|
|
14
|
-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
|
|
15
|
-
# unavailable (missing or closed)
|
|
16
|
-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves
|
|
17
|
-
# into no concrete indices.
|
|
18
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices
|
|
19
|
-
# that are open, closed or both.
|
|
20
|
-
# (options: open, closed, none, all)
|
|
21
|
-
# @option arguments [Number] :min_score Include only documents with a specific `_score` value in the result
|
|
22
|
-
# @option arguments [String] :preference Specify the node or shard the operation should be performed on
|
|
23
|
-
# (default: random)
|
|
24
|
-
# @option arguments [String] :routing Specific routing value
|
|
25
|
-
# @option arguments [String] :q Query in the Lucene query string syntax
|
|
26
|
-
# @option arguments [String] :analyzer The analyzer to use for the query string
|
|
27
|
-
# @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be
|
|
28
|
-
# analyzed (default: false)
|
|
29
|
-
# @option arguments [String] :default_operator The default operator for query string query (AND or OR)
|
|
30
|
-
# (options: AND, OR)
|
|
31
|
-
# @option arguments [String] :df The field to use as default where no field prefix is given
|
|
32
|
-
# in the query string
|
|
33
|
-
# @option arguments [Boolean] :lenient Specify whether format-based query failures
|
|
34
|
-
# (such as providing text to a numeric field) should be ignored
|
|
35
|
-
# @option arguments [Boolean] :lowercase_expanded_terms Specify whether query terms should be lowercased
|
|
36
|
-
#
|
|
37
|
-
# @see http://www.elastic.co/guide/en/elasticsearch/reference/master/search-exists.html
|
|
38
|
-
#
|
|
39
|
-
def search_exists(arguments={})
|
|
40
|
-
method = 'POST'
|
|
41
|
-
path = "_search/exists"
|
|
42
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
43
|
-
body = arguments[:body]
|
|
44
|
-
|
|
45
|
-
perform_request(method, path, params, body).body
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
# Register this action with its valid params when the module is loaded.
|
|
49
|
-
#
|
|
50
|
-
# @since 6.2.0
|
|
51
|
-
ParamsRegistry.register(:search_exists, [
|
|
52
|
-
:ignore_unavailable,
|
|
53
|
-
:allow_no_indices,
|
|
54
|
-
:expand_wildcards,
|
|
55
|
-
:min_score,
|
|
56
|
-
:preference,
|
|
57
|
-
:routing,
|
|
58
|
-
:q,
|
|
59
|
-
:analyzer,
|
|
60
|
-
:analyze_wildcard,
|
|
61
|
-
:default_operator,
|
|
62
|
-
:df,
|
|
63
|
-
:lenient,
|
|
64
|
-
:lowercase_expanded_terms ].freeze)
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
module Elasticsearch
|
|
6
|
-
module API
|
|
7
|
-
module Actions
|
|
8
|
-
|
|
9
|
-
# Return query terms suggestions based on provided text and configuration.
|
|
10
|
-
#
|
|
11
|
-
# Pass the request definition in the `:body` argument.
|
|
12
|
-
#
|
|
13
|
-
# @example Return query terms suggestions ("auto-correction")
|
|
14
|
-
#
|
|
15
|
-
# client.suggest index: 'myindex',
|
|
16
|
-
# body: { my_suggest: { text: 'tset', term: { field: 'title' } } }
|
|
17
|
-
# # => { ... "my_suggest"=>[ {"text"=>"tset", ... "options"=>[{"text"=>"test", "score"=>0.75, "freq"=>5}] }]}
|
|
18
|
-
#
|
|
19
|
-
# @option arguments [List] :index A comma-separated list of index names to restrict the operation;
|
|
20
|
-
# use `_all` or empty string to perform the operation on all indices
|
|
21
|
-
# @option arguments [Hash] :body The request definition
|
|
22
|
-
# @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore `missing` ones
|
|
23
|
-
# (options: none, missing)
|
|
24
|
-
# @option arguments [String] :preference Specify the node or shard the operation should be performed on
|
|
25
|
-
# (default: random)
|
|
26
|
-
# @option arguments [String] :routing Specific routing value
|
|
27
|
-
# @option arguments [String] :source The URL-encoded request definition (instead of using request body)
|
|
28
|
-
#
|
|
29
|
-
# @since 0.90
|
|
30
|
-
#
|
|
31
|
-
# @see http://elasticsearch.org/guide/reference/api/search/suggest/
|
|
32
|
-
#
|
|
33
|
-
def suggest(arguments={})
|
|
34
|
-
method = HTTP_POST
|
|
35
|
-
path = Utils.__pathify( Utils.__listify(arguments[:index]), '_suggest' )
|
|
36
|
-
|
|
37
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
38
|
-
body = arguments[:body]
|
|
39
|
-
|
|
40
|
-
perform_request(method, path, params, body).body
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
# Register this action with its valid params when the module is loaded.
|
|
44
|
-
#
|
|
45
|
-
# @since 6.2.0
|
|
46
|
-
ParamsRegistry.register(:suggest, [
|
|
47
|
-
:ignore_indices,
|
|
48
|
-
:preference,
|
|
49
|
-
:routing,
|
|
50
|
-
:source ].freeze)
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
require 'spec_helper'
|
|
6
|
-
|
|
7
|
-
describe 'client#count_percolate' do
|
|
8
|
-
|
|
9
|
-
let(:expected_args) do
|
|
10
|
-
[
|
|
11
|
-
'GET',
|
|
12
|
-
'foo/bar/_percolate/count',
|
|
13
|
-
{},
|
|
14
|
-
{ doc: { foo: 'bar' } }
|
|
15
|
-
]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'performs the request' do
|
|
19
|
-
expect(client_double.count_percolate(index: 'foo', type: 'bar', body: { doc: { foo: 'bar' } })).to eq({})
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
require 'spec_helper'
|
|
6
|
-
|
|
7
|
-
describe 'client#delete_template' do
|
|
8
|
-
|
|
9
|
-
let(:expected_args) do
|
|
10
|
-
[
|
|
11
|
-
'DELETE',
|
|
12
|
-
'_search/template/foo',
|
|
13
|
-
{},
|
|
14
|
-
nil
|
|
15
|
-
]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'performs the request' do
|
|
19
|
-
expect(client_double.delete_template(id: 'foo')).to eq({})
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
require 'spec_helper'
|
|
6
|
-
|
|
7
|
-
describe 'client#field_stats' do
|
|
8
|
-
|
|
9
|
-
let(:expected_args) do
|
|
10
|
-
[
|
|
11
|
-
'GET',
|
|
12
|
-
'_field_stats',
|
|
13
|
-
{ },
|
|
14
|
-
nil
|
|
15
|
-
]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'performs the request' do
|
|
19
|
-
expect(client_double.field_stats).to eq({})
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
require 'spec_helper'
|
|
6
|
-
|
|
7
|
-
describe 'client#get_template' do
|
|
8
|
-
|
|
9
|
-
let(:expected_args) do
|
|
10
|
-
[
|
|
11
|
-
'GET',
|
|
12
|
-
url,
|
|
13
|
-
params,
|
|
14
|
-
nil
|
|
15
|
-
]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
let(:params) do
|
|
19
|
-
{ }
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
let(:client) do
|
|
23
|
-
Class.new { include Elasticsearch::API }.new
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
context 'when the `lang` parameter is specified' do
|
|
27
|
-
|
|
28
|
-
let(:url) do
|
|
29
|
-
'_scripts/foo'
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it 'performs the request' do
|
|
33
|
-
expect(client_double.get_template(id: 'foo')).to eq({})
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
context 'when the request raises a NotFound exception' do
|
|
38
|
-
|
|
39
|
-
before do
|
|
40
|
-
expect(client).to receive(:perform_request).and_raise(NotFound)
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it 'raises the exception' do
|
|
44
|
-
expect {
|
|
45
|
-
client.get_template(id: 'foo')
|
|
46
|
-
}.to raise_exception(NotFound)
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
context 'when the ignore parameter is specified' do
|
|
50
|
-
|
|
51
|
-
it 'returns false' do
|
|
52
|
-
expect(client.get_template(id: 'foo', ignore: 404)).to eq(false)
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
require 'spec_helper'
|
|
6
|
-
|
|
7
|
-
describe 'client.indices#delete_mapping' do
|
|
8
|
-
|
|
9
|
-
let(:expected_args) do
|
|
10
|
-
[
|
|
11
|
-
'DELETE',
|
|
12
|
-
url,
|
|
13
|
-
params,
|
|
14
|
-
nil,
|
|
15
|
-
nil
|
|
16
|
-
]
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
let(:params) do
|
|
20
|
-
{}
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
context 'when there is no index specified' do
|
|
24
|
-
|
|
25
|
-
let(:client) do
|
|
26
|
-
Class.new { include Elasticsearch::API }.new
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'raises an exception' do
|
|
30
|
-
expect {
|
|
31
|
-
client.indices.delete_mapping(type: 'foo')
|
|
32
|
-
}.to raise_exception(ArgumentError)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
context 'when there is no type specified' do
|
|
37
|
-
|
|
38
|
-
let(:client) do
|
|
39
|
-
Class.new { include Elasticsearch::API }.new
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
it 'raises an exception' do
|
|
43
|
-
expect {
|
|
44
|
-
client.indices.delete_mapping(index: 'foo')
|
|
45
|
-
}.to raise_exception(ArgumentError)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
context 'when an index and type are specified' do
|
|
50
|
-
|
|
51
|
-
let(:url) do
|
|
52
|
-
'foo/bar'
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it 'performs the request' do
|
|
56
|
-
expect(client_double.indices.delete_mapping(index: 'foo', type: 'bar')).to eq({})
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
context 'when multiple indices are specified' do
|
|
61
|
-
|
|
62
|
-
let(:url) do
|
|
63
|
-
'foo,bar/baz'
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
it 'performs the request' do
|
|
67
|
-
expect(client_double.indices.delete_mapping(index: ['foo','bar'], type: 'baz')).to eq({})
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
context 'when the path must be URL-escaped' do
|
|
72
|
-
|
|
73
|
-
let(:url) do
|
|
74
|
-
'foo%5Ebar/bar%2Fbam'
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
it 'performs the request' do
|
|
78
|
-
expect(client_double.indices.delete_mapping(index: 'foo^bar', type: 'bar/bam')).to eq({})
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# Licensed to Elasticsearch B.V under one or more agreements.
|
|
2
|
-
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
|
|
3
|
-
# See the LICENSE file in the project root for more information
|
|
4
|
-
|
|
5
|
-
require 'spec_helper'
|
|
6
|
-
|
|
7
|
-
describe 'client.indices#delete_warmer' do
|
|
8
|
-
|
|
9
|
-
let(:expected_args) do
|
|
10
|
-
[
|
|
11
|
-
'DELETE',
|
|
12
|
-
url,
|
|
13
|
-
params,
|
|
14
|
-
nil,
|
|
15
|
-
nil
|
|
16
|
-
]
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
let(:params) do
|
|
20
|
-
{}
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
context 'when an index is not specified' do
|
|
24
|
-
|
|
25
|
-
let(:client) do
|
|
26
|
-
Class.new { include Elasticsearch::API }.new
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'raises an exception' do
|
|
30
|
-
expect {
|
|
31
|
-
client.indices.delete_warmer
|
|
32
|
-
}.to raise_exception(ArgumentError)
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
context 'when an index is specified' do
|
|
37
|
-
|
|
38
|
-
let(:url) do
|
|
39
|
-
'foo/_warmer'
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
it 'performs the request' do
|
|
43
|
-
expect(client_double.indices.delete_warmer(index: 'foo')).to eq({})
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
context 'when multiple indices are specified' do
|
|
48
|
-
|
|
49
|
-
let(:url) do
|
|
50
|
-
'foo,bar/_warmer'
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
it 'performs the request' do
|
|
54
|
-
expect(client_double.indices.delete_warmer(index: ['foo', 'bar'])).to eq({})
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
context 'when a single warmer is specified' do
|
|
59
|
-
|
|
60
|
-
let(:url) do
|
|
61
|
-
'foo/_warmer/bar'
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it 'performs the request' do
|
|
65
|
-
expect(client_double.indices.delete_warmer(index: 'foo', name: 'bar')).to eq({})
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
context 'when a multiple warmers are specified' do
|
|
70
|
-
|
|
71
|
-
let(:url) do
|
|
72
|
-
'foo/_warmer/bar,baz'
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
it 'performs the request' do
|
|
76
|
-
expect(client_double.indices.delete_warmer(index: 'foo', name: ['bar', 'baz'])).to eq({})
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
context 'when the path needs to be URL-escaped' do
|
|
81
|
-
|
|
82
|
-
let(:url) do
|
|
83
|
-
'foo%5Ebar/_warmer/bar%2Fbam'
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
it 'performs the request' do
|
|
87
|
-
expect(client_double.indices.delete_warmer(index: 'foo^bar', name: 'bar/bam')).to eq({})
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
end
|