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,69 +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 Indices
|
|
8
|
-
module Actions
|
|
9
|
-
|
|
10
|
-
# Create or update an index warmer.
|
|
11
|
-
#
|
|
12
|
-
# An index warmer will run before an index is refreshed, ie. available for search.
|
|
13
|
-
# It allows you to register "heavy" queries with popular filters, facets or sorts,
|
|
14
|
-
# increasing performance when the index is searched for the first time.
|
|
15
|
-
#
|
|
16
|
-
# @example Register a warmer which will populate the caches for `published` filter and sorting on `created_at`
|
|
17
|
-
#
|
|
18
|
-
# client.indices.put_warmer index: 'myindex',
|
|
19
|
-
# name: 'main',
|
|
20
|
-
# body: {
|
|
21
|
-
# query: { filtered: { filter: { term: { published: true } } } },
|
|
22
|
-
# sort: [ "created_at" ]
|
|
23
|
-
# }
|
|
24
|
-
#
|
|
25
|
-
# @option arguments [List] :index A comma-separated list of index names to register the warmer for; use `_all`
|
|
26
|
-
# or empty string to perform the operation on all indices (*Required*)
|
|
27
|
-
# @option arguments [String] :name The name of the warmer (*Required*)
|
|
28
|
-
# @option arguments [List] :type A comma-separated list of document types to register the warmer for;
|
|
29
|
-
# leave empty to perform the operation on all types
|
|
30
|
-
# @option arguments [Hash] :body The search request definition for the warmer
|
|
31
|
-
# (query, filters, facets, sorting, etc) (*Required*)
|
|
32
|
-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
|
|
33
|
-
# no concrete indices. (This includes `_all` string or when no
|
|
34
|
-
# indices have been specified)
|
|
35
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that
|
|
36
|
-
# are open, closed or both. (options: open, closed)
|
|
37
|
-
# @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore
|
|
38
|
-
# `missing` ones (options: none, missing) @until 1.0
|
|
39
|
-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
|
|
40
|
-
# unavailable (missing, closed, etc)
|
|
41
|
-
#
|
|
42
|
-
# @see http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/
|
|
43
|
-
#
|
|
44
|
-
def put_warmer(arguments={})
|
|
45
|
-
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
|
46
|
-
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
|
47
|
-
method = HTTP_PUT
|
|
48
|
-
path = Utils.__pathify( Utils.__listify(arguments[:index]),
|
|
49
|
-
Utils.__listify(arguments[:type]),
|
|
50
|
-
'_warmer',
|
|
51
|
-
Utils.__listify(arguments[:name]) )
|
|
52
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
53
|
-
body = arguments[:body]
|
|
54
|
-
|
|
55
|
-
perform_request(method, path, params, body).body
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
# Register this action with its valid params when the module is loaded.
|
|
59
|
-
#
|
|
60
|
-
# @since 6.2.0
|
|
61
|
-
ParamsRegistry.register(:put_warmer, [
|
|
62
|
-
:ignore_indices,
|
|
63
|
-
:ignore_unavailable,
|
|
64
|
-
:allow_no_indices,
|
|
65
|
-
:expand_wildcards ].freeze)
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
end
|
|
@@ -1,28 +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 Indices
|
|
8
|
-
module Actions
|
|
9
|
-
|
|
10
|
-
# "Seal" and index or indices for faster recovery
|
|
11
|
-
#
|
|
12
|
-
# @option arguments [List] :index A comma-separated list of index names;
|
|
13
|
-
# use `_all` or empty string for all indices
|
|
14
|
-
#
|
|
15
|
-
# @see http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-seal.html
|
|
16
|
-
#
|
|
17
|
-
def seal(arguments={})
|
|
18
|
-
method = 'POST'
|
|
19
|
-
path = Utils.__pathify Utils.__listify(arguments[:index]), '_seal'
|
|
20
|
-
params = {}
|
|
21
|
-
body = nil
|
|
22
|
-
|
|
23
|
-
perform_request(method, path, params, body).body
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
@@ -1,48 +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 Indices
|
|
8
|
-
module Actions
|
|
9
|
-
|
|
10
|
-
# When using the shared storage gateway, manually trigger the snapshot operation.
|
|
11
|
-
#
|
|
12
|
-
# @deprecated The shared gateway has been deprecated [https://github.com/elasticsearch/elasticsearch/issues/2458]
|
|
13
|
-
#
|
|
14
|
-
# @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
|
|
15
|
-
# to perform the operation on all indices
|
|
16
|
-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
|
|
17
|
-
# no concrete indices. (This includes `_all` string or when no
|
|
18
|
-
# indices have been specified)
|
|
19
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that
|
|
20
|
-
# are open, closed or both. (options: open, closed)
|
|
21
|
-
# @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore
|
|
22
|
-
# `missing` ones (options: none, missing) @until 1.0
|
|
23
|
-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
|
|
24
|
-
# unavailable (missing, closed, etc)
|
|
25
|
-
#
|
|
26
|
-
# @see http://www.elasticsearch.org/guide/reference/api/admin-indices-gateway-snapshot/
|
|
27
|
-
#
|
|
28
|
-
def snapshot_index(arguments={})
|
|
29
|
-
method = HTTP_POST
|
|
30
|
-
path = Utils.__pathify Utils.__listify(arguments[:index]), '_gateway/snapshot'
|
|
31
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
32
|
-
body = nil
|
|
33
|
-
|
|
34
|
-
perform_request(method, path, params, body).body
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
# Register this action with its valid params when the module is loaded.
|
|
38
|
-
#
|
|
39
|
-
# @since 6.2.0
|
|
40
|
-
ParamsRegistry.register(:snapshot_index, [
|
|
41
|
-
:ignore_indices,
|
|
42
|
-
:ignore_unavailable,
|
|
43
|
-
:allow_no_indices,
|
|
44
|
-
:expand_wildcards ].freeze)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
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 Indices
|
|
8
|
-
module Actions
|
|
9
|
-
|
|
10
|
-
# Return information about one or more indices
|
|
11
|
-
#
|
|
12
|
-
# @example Get information about all indices
|
|
13
|
-
#
|
|
14
|
-
# client.indices.status
|
|
15
|
-
#
|
|
16
|
-
# @example Get information about a specific index
|
|
17
|
-
#
|
|
18
|
-
# client.indices.status index: 'foo'
|
|
19
|
-
#
|
|
20
|
-
# @example Get information about shard recovery for a specific index
|
|
21
|
-
#
|
|
22
|
-
# client.indices.status index: 'foo', recovery: true
|
|
23
|
-
#
|
|
24
|
-
# @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
|
|
25
|
-
# to perform the operation on all indices
|
|
26
|
-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
|
|
27
|
-
# no concrete indices. (This includes `_all` string or when no
|
|
28
|
-
# indices have been specified)
|
|
29
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that
|
|
30
|
-
# are open, closed or both. (options: open, closed)
|
|
31
|
-
# @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore
|
|
32
|
-
# `missing` ones (options: none, missing) @until 1.0
|
|
33
|
-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
|
|
34
|
-
# unavailable (missing, closed, etc)
|
|
35
|
-
# @option arguments [Boolean] :recovery Return information about shard recovery (progress, size, etc)
|
|
36
|
-
# @option arguments [Boolean] :snapshot Return information about snapshots (when shared gateway is used)
|
|
37
|
-
#
|
|
38
|
-
# @see http://elasticsearch.org/guide/reference/api/admin-indices-status/
|
|
39
|
-
#
|
|
40
|
-
def status(arguments={})
|
|
41
|
-
method = HTTP_GET
|
|
42
|
-
path = Utils.__pathify Utils.__listify(arguments[:index]), '_status'
|
|
43
|
-
|
|
44
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
45
|
-
body = nil
|
|
46
|
-
|
|
47
|
-
if Array(arguments[:ignore]).include?(404)
|
|
48
|
-
Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
|
|
49
|
-
else
|
|
50
|
-
perform_request(method, path, params, body).body
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
# Register this action with its valid params when the module is loaded.
|
|
55
|
-
#
|
|
56
|
-
# @since 6.2.0
|
|
57
|
-
ParamsRegistry.register(:status, [
|
|
58
|
-
:ignore_indices,
|
|
59
|
-
:ignore_unavailable,
|
|
60
|
-
:allow_no_indices,
|
|
61
|
-
:expand_wildcards,
|
|
62
|
-
:recovery,
|
|
63
|
-
:snapshot ].freeze)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
@@ -1,31 +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 a list of running benchmarks
|
|
10
|
-
#
|
|
11
|
-
# @example
|
|
12
|
-
#
|
|
13
|
-
# client.list_benchmarks
|
|
14
|
-
#
|
|
15
|
-
# @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
|
|
16
|
-
# to perform the operation on all indices
|
|
17
|
-
# @option arguments [String] :type The name of the document type
|
|
18
|
-
#
|
|
19
|
-
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html
|
|
20
|
-
#
|
|
21
|
-
def list_benchmarks(arguments={})
|
|
22
|
-
method = HTTP_GET
|
|
23
|
-
path = "_bench"
|
|
24
|
-
params = {}
|
|
25
|
-
body = nil
|
|
26
|
-
|
|
27
|
-
perform_request(method, path, params, body).body
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,134 +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 documents similar to the specified one.
|
|
10
|
-
#
|
|
11
|
-
# Performs a `more_like_this` query with the specified document as the input.
|
|
12
|
-
#
|
|
13
|
-
# @example Search for similar documents using the `title` property of document `myindex/mytype/1`
|
|
14
|
-
#
|
|
15
|
-
# # First, let's setup a synonym-aware analyzer ("quick" <=> "fast")
|
|
16
|
-
# client.indices.create index: 'myindex', body: {
|
|
17
|
-
# settings: {
|
|
18
|
-
# analysis: {
|
|
19
|
-
# filter: {
|
|
20
|
-
# synonyms: {
|
|
21
|
-
# type: 'synonym',
|
|
22
|
-
# synonyms: [ "quick,fast" ]
|
|
23
|
-
# }
|
|
24
|
-
# },
|
|
25
|
-
# analyzer: {
|
|
26
|
-
# title_synonym: {
|
|
27
|
-
# type: 'custom',
|
|
28
|
-
# tokenizer: 'whitespace',
|
|
29
|
-
# filter: ['lowercase', 'stop', 'snowball', 'synonyms']
|
|
30
|
-
# }
|
|
31
|
-
# }
|
|
32
|
-
# }
|
|
33
|
-
# },
|
|
34
|
-
# mappings: {
|
|
35
|
-
# mytype: {
|
|
36
|
-
# properties: {
|
|
37
|
-
# title: {
|
|
38
|
-
# type: 'string',
|
|
39
|
-
# analyzer: 'title_synonym'
|
|
40
|
-
# }
|
|
41
|
-
# }
|
|
42
|
-
# }
|
|
43
|
-
# }
|
|
44
|
-
# }
|
|
45
|
-
#
|
|
46
|
-
# # Index three documents
|
|
47
|
-
# client.index index: 'myindex', type: 'mytype', id: 1, body: { title: 'Quick Brown Fox' }
|
|
48
|
-
# client.index index: 'myindex', type: 'mytype', id: 2, body: { title: 'Slow Black Dog' }
|
|
49
|
-
# client.index index: 'myindex', type: 'mytype', id: 3, body: { title: 'Fast White Rabbit' }
|
|
50
|
-
# client.indices.refresh index: 'myindex'
|
|
51
|
-
#
|
|
52
|
-
# client.mlt index: 'myindex', type: 'mytype', id: 1, mlt_fields: 'title', min_doc_freq: 1, min_term_freq: 1
|
|
53
|
-
# # => { ... {"title"=>"Fast White Rabbit"}}]}}
|
|
54
|
-
#
|
|
55
|
-
# @option arguments [String] :id The document ID (*Required*)
|
|
56
|
-
# @option arguments [String] :index The name of the index (*Required*)
|
|
57
|
-
# @option arguments [String] :type The type of the document (use `_all` to fetch
|
|
58
|
-
# the first document matching the ID across all types) (*Required*)
|
|
59
|
-
# @option arguments [Hash] :body A specific search request definition
|
|
60
|
-
# @option arguments [Number] :boost_terms The boost factor
|
|
61
|
-
# @option arguments [Number] :max_doc_freq The word occurrence frequency as count: words with higher occurrence
|
|
62
|
-
# in the corpus will be ignored
|
|
63
|
-
# @option arguments [Number] :max_query_terms The maximum query terms to be included in the generated query
|
|
64
|
-
# @option arguments [Number] :max_word_len The minimum length of the word: longer words will be ignored
|
|
65
|
-
# @option arguments [Number] :min_doc_freq The word occurrence frequency as count: words with lower occurrence
|
|
66
|
-
# in the corpus will be ignored
|
|
67
|
-
# @option arguments [Number] :min_term_freq The term frequency as percent: terms with lower occurence
|
|
68
|
-
# in the source document will be ignored
|
|
69
|
-
# @option arguments [Number] :min_word_len The minimum length of the word: shorter words will be ignored
|
|
70
|
-
# @option arguments [List] :mlt_fields Specific fields to perform the query against
|
|
71
|
-
# @option arguments [Number] :percent_terms_to_match How many terms have to match in order to consider
|
|
72
|
-
# the document a match (default: 0.3)
|
|
73
|
-
# @option arguments [String] :routing Specific routing value
|
|
74
|
-
# @option arguments [Number] :search_from The offset from which to return results
|
|
75
|
-
# @option arguments [List] :search_indices A comma-separated list of indices to perform the query against
|
|
76
|
-
# (default: the index containing the document)
|
|
77
|
-
# @option arguments [String] :search_query_hint The search query hint
|
|
78
|
-
# @option arguments [String] :search_scroll A scroll search request definition
|
|
79
|
-
# @option arguments [Number] :search_size The number of documents to return (default: 10)
|
|
80
|
-
# @option arguments [String] :search_source A specific search request definition (instead of using the request body)
|
|
81
|
-
# @option arguments [String] :search_type Specific search type (eg. `dfs_then_fetch`, `count`, etc)
|
|
82
|
-
# @option arguments [List] :search_types A comma-separated list of types to perform the query against
|
|
83
|
-
# (default: the same type as the document)
|
|
84
|
-
# @option arguments [List] :stop_words A list of stop words to be ignored
|
|
85
|
-
#
|
|
86
|
-
# @see http://elasticsearch.org/guide/reference/api/more-like-this/
|
|
87
|
-
#
|
|
88
|
-
def mlt(arguments={})
|
|
89
|
-
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
|
90
|
-
raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
|
|
91
|
-
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
|
92
|
-
method = HTTP_GET
|
|
93
|
-
path = Utils.__pathify Utils.__escape(arguments[:index]),
|
|
94
|
-
Utils.__escape(arguments[:type]),
|
|
95
|
-
Utils.__escape(arguments[:id]),
|
|
96
|
-
'_mlt'
|
|
97
|
-
|
|
98
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
99
|
-
|
|
100
|
-
[:mlt_fields, :search_indices, :search_types, :stop_words].each do |name|
|
|
101
|
-
params[name] = Utils.__listify(params[name]) if params[name]
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
body = arguments[:body]
|
|
105
|
-
|
|
106
|
-
perform_request(method, path, params, body).body
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
# Register this action with its valid params when the module is loaded.
|
|
110
|
-
#
|
|
111
|
-
# @since 6.2.0
|
|
112
|
-
ParamsRegistry.register(:mlt, [
|
|
113
|
-
:boost_terms,
|
|
114
|
-
:max_doc_freq,
|
|
115
|
-
:max_query_terms,
|
|
116
|
-
:max_word_len,
|
|
117
|
-
:min_doc_freq,
|
|
118
|
-
:min_term_freq,
|
|
119
|
-
:min_word_len,
|
|
120
|
-
:mlt_fields,
|
|
121
|
-
:percent_terms_to_match,
|
|
122
|
-
:routing,
|
|
123
|
-
:search_from,
|
|
124
|
-
:search_indices,
|
|
125
|
-
:search_query_hint,
|
|
126
|
-
:search_scroll,
|
|
127
|
-
:search_size,
|
|
128
|
-
:search_source,
|
|
129
|
-
:search_type,
|
|
130
|
-
:search_types,
|
|
131
|
-
:stop_words ].freeze)
|
|
132
|
-
end
|
|
133
|
-
end
|
|
134
|
-
end
|
|
@@ -1,66 +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
|
-
# Perform multiple percolate operations in a single request, similar to the {#msearch} API
|
|
10
|
-
#
|
|
11
|
-
# Pass the percolate definitions as header-body pairs in the `:body` argument, as an Array of Hashes.
|
|
12
|
-
#
|
|
13
|
-
# @example Perform two different percolations in a single request
|
|
14
|
-
#
|
|
15
|
-
# client.mpercolate \
|
|
16
|
-
# body: [
|
|
17
|
-
# { percolate: { index: "my-index", type: "my-type" } },
|
|
18
|
-
# { doc: { message: "foo bar" } },
|
|
19
|
-
# { percolate: { index: "my-other-index", type: "my-other-type", id: "1" } },
|
|
20
|
-
# { }
|
|
21
|
-
# ]
|
|
22
|
-
#
|
|
23
|
-
# @option arguments [String] :index The index of the document being count percolated to use as default
|
|
24
|
-
# @option arguments [String] :type The type of the document being percolated to use as default.
|
|
25
|
-
# @option arguments [Array<Hash>] The percolate request definitions (header & body pairs) (*Required*)
|
|
26
|
-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
|
|
27
|
-
# unavailable (missing or closed)
|
|
28
|
-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
|
|
29
|
-
# no concrete indices. (This includes `_all` string or when no
|
|
30
|
-
# indices have been specified)
|
|
31
|
-
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are
|
|
32
|
-
# open, closed or both. (options: open, closed)
|
|
33
|
-
#
|
|
34
|
-
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-percolate.html
|
|
35
|
-
#
|
|
36
|
-
def mpercolate(arguments={})
|
|
37
|
-
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
|
|
38
|
-
method = HTTP_GET
|
|
39
|
-
path = "_mpercolate"
|
|
40
|
-
|
|
41
|
-
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
|
|
42
|
-
body = arguments[:body]
|
|
43
|
-
|
|
44
|
-
case
|
|
45
|
-
when body.is_a?(Array)
|
|
46
|
-
payload = body.map { |d| d.is_a?(String) ? d : Elasticsearch::API.serializer.dump(d) }
|
|
47
|
-
payload << "" unless payload.empty?
|
|
48
|
-
payload = payload.join("\n")
|
|
49
|
-
else
|
|
50
|
-
payload = body
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
perform_request(method, path, params, payload).body
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# Register this action with its valid params when the module is loaded.
|
|
57
|
-
#
|
|
58
|
-
# @since 6.2.0
|
|
59
|
-
ParamsRegistry.register(:mpercolate, [
|
|
60
|
-
:ignore_unavailable,
|
|
61
|
-
:allow_no_indices,
|
|
62
|
-
:expand_wildcards,
|
|
63
|
-
:percolate_format ].freeze)
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|