elasticsearch-api 6.2.0 → 6.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -1
  3. data/lib/elasticsearch/api/actions/benchmark.rb +1 -1
  4. data/lib/elasticsearch/api/actions/bulk.rb +4 -6
  5. data/lib/elasticsearch/api/actions/cat/aliases.rb +10 -10
  6. data/lib/elasticsearch/api/actions/cat/allocation.rb +11 -11
  7. data/lib/elasticsearch/api/actions/cat/count.rb +10 -10
  8. data/lib/elasticsearch/api/actions/cat/fielddata.rb +9 -7
  9. data/lib/elasticsearch/api/actions/cat/health.rb +11 -11
  10. data/lib/elasticsearch/api/actions/cat/help.rb +4 -2
  11. data/lib/elasticsearch/api/actions/cat/indices.rb +14 -15
  12. data/lib/elasticsearch/api/actions/cat/master.rb +10 -10
  13. data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +6 -4
  14. data/lib/elasticsearch/api/actions/cat/nodes.rb +10 -10
  15. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +10 -10
  16. data/lib/elasticsearch/api/actions/cat/plugins.rb +7 -6
  17. data/lib/elasticsearch/api/actions/cat/recovery.rb +10 -12
  18. data/lib/elasticsearch/api/actions/cat/repositories.rb +7 -3
  19. data/lib/elasticsearch/api/actions/cat/segments.rb +9 -7
  20. data/lib/elasticsearch/api/actions/cat/shards.rb +12 -12
  21. data/lib/elasticsearch/api/actions/cat/snapshots.rb +8 -4
  22. data/lib/elasticsearch/api/actions/cat/tasks.rb +4 -6
  23. data/lib/elasticsearch/api/actions/cat/templates.rb +6 -6
  24. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +13 -17
  25. data/lib/elasticsearch/api/actions/clear_scroll.rb +7 -0
  26. data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +2 -3
  27. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +5 -2
  28. data/lib/elasticsearch/api/actions/cluster/health.rb +11 -20
  29. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +2 -3
  30. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +8 -3
  31. data/lib/elasticsearch/api/actions/cluster/remote_info.rb +7 -1
  32. data/lib/elasticsearch/api/actions/cluster/reroute.rb +7 -7
  33. data/lib/elasticsearch/api/actions/cluster/state.rb +18 -15
  34. data/lib/elasticsearch/api/actions/cluster/stats.rb +12 -5
  35. data/lib/elasticsearch/api/actions/count.rb +12 -23
  36. data/lib/elasticsearch/api/actions/count_percolate.rb +1 -1
  37. data/lib/elasticsearch/api/actions/delete.rb +16 -8
  38. data/lib/elasticsearch/api/actions/delete_by_query.rb +7 -9
  39. data/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +29 -0
  40. data/lib/elasticsearch/api/actions/delete_script.rb +5 -6
  41. data/lib/elasticsearch/api/actions/exists.rb +3 -4
  42. data/lib/elasticsearch/api/actions/exists_source.rb +51 -0
  43. data/lib/elasticsearch/api/actions/explain.rb +11 -25
  44. data/lib/elasticsearch/api/actions/field_caps.rb +2 -2
  45. data/lib/elasticsearch/api/actions/get.rb +13 -19
  46. data/lib/elasticsearch/api/actions/get_script.rb +9 -2
  47. data/lib/elasticsearch/api/actions/get_source.rb +10 -14
  48. data/lib/elasticsearch/api/actions/index.rb +10 -16
  49. data/lib/elasticsearch/api/actions/indices/analyze.rb +3 -27
  50. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +2 -4
  51. data/lib/elasticsearch/api/actions/indices/close.rb +9 -15
  52. data/lib/elasticsearch/api/actions/indices/create.rb +7 -7
  53. data/lib/elasticsearch/api/actions/indices/delete.rb +3 -4
  54. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +7 -4
  55. data/lib/elasticsearch/api/actions/indices/delete_template.rb +5 -2
  56. data/lib/elasticsearch/api/actions/indices/exists.rb +11 -17
  57. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +6 -14
  58. data/lib/elasticsearch/api/actions/indices/exists_template.rb +8 -4
  59. data/lib/elasticsearch/api/actions/indices/exists_type.rb +6 -15
  60. data/lib/elasticsearch/api/actions/indices/flush.rb +5 -9
  61. data/lib/elasticsearch/api/actions/indices/flush_synced.rb +1 -1
  62. data/lib/elasticsearch/api/actions/indices/forcemerge.rb +13 -11
  63. data/lib/elasticsearch/api/actions/indices/freeze.rb +0 -1
  64. data/lib/elasticsearch/api/actions/indices/get.rb +9 -15
  65. data/lib/elasticsearch/api/actions/indices/get_alias.rb +6 -14
  66. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +11 -15
  67. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +12 -16
  68. data/lib/elasticsearch/api/actions/indices/get_settings.rb +12 -21
  69. data/lib/elasticsearch/api/actions/indices/get_template.rb +8 -5
  70. data/lib/elasticsearch/api/actions/indices/open.rb +9 -15
  71. data/lib/elasticsearch/api/actions/indices/put_alias.rb +6 -3
  72. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +11 -23
  73. data/lib/elasticsearch/api/actions/indices/put_settings.rb +10 -20
  74. data/lib/elasticsearch/api/actions/indices/put_template.rb +10 -5
  75. data/lib/elasticsearch/api/actions/indices/recovery.rb +2 -4
  76. data/lib/elasticsearch/api/actions/indices/refresh.rb +6 -14
  77. data/lib/elasticsearch/api/actions/indices/rollover.rb +6 -5
  78. data/lib/elasticsearch/api/actions/indices/segments.rb +6 -14
  79. data/lib/elasticsearch/api/actions/indices/shard_stores.rb +2 -4
  80. data/lib/elasticsearch/api/actions/indices/shrink.rb +6 -7
  81. data/lib/elasticsearch/api/actions/indices/split.rb +2 -1
  82. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +7 -4
  83. data/lib/elasticsearch/api/actions/indices/upgrade.rb +10 -13
  84. data/lib/elasticsearch/api/actions/indices/validate_query.rb +14 -25
  85. data/lib/elasticsearch/api/actions/info.rb +6 -0
  86. data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +1 -1
  87. data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +4 -3
  88. data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +29 -0
  89. data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +1 -1
  90. data/lib/elasticsearch/api/actions/ingest/simulate.rb +5 -5
  91. data/lib/elasticsearch/api/actions/mget.rb +8 -17
  92. data/lib/elasticsearch/api/actions/msearch.rb +7 -2
  93. data/lib/elasticsearch/api/actions/msearch_template.rb +8 -1
  94. data/lib/elasticsearch/api/actions/mtermvectors.rb +21 -22
  95. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +4 -6
  96. data/lib/elasticsearch/api/actions/nodes/info.rb +6 -26
  97. data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +10 -4
  98. data/lib/elasticsearch/api/actions/nodes/stats.rb +11 -30
  99. data/lib/elasticsearch/api/actions/nodes/usage.rb +31 -0
  100. data/lib/elasticsearch/api/actions/ping.rb +6 -0
  101. data/lib/elasticsearch/api/actions/put_script.rb +10 -9
  102. data/lib/elasticsearch/api/actions/rank_eval.rb +36 -0
  103. data/lib/elasticsearch/api/actions/reindex.rb +9 -14
  104. data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +29 -0
  105. data/lib/elasticsearch/api/actions/render_search_template.rb +1 -1
  106. data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +27 -0
  107. data/lib/elasticsearch/api/actions/scroll.rb +3 -2
  108. data/lib/elasticsearch/api/actions/search.rb +36 -53
  109. data/lib/elasticsearch/api/actions/search_shards.rb +7 -14
  110. data/lib/elasticsearch/api/actions/search_template.rb +20 -19
  111. data/lib/elasticsearch/api/actions/snapshot/create.rb +2 -3
  112. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +4 -3
  113. data/lib/elasticsearch/api/actions/snapshot/delete.rb +3 -3
  114. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +1 -2
  115. data/lib/elasticsearch/api/actions/snapshot/get.rb +3 -3
  116. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +3 -6
  117. data/lib/elasticsearch/api/actions/snapshot/restore.rb +1 -1
  118. data/lib/elasticsearch/api/actions/snapshot/status.rb +4 -5
  119. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +1 -2
  120. data/lib/elasticsearch/api/actions/tasks/cancel.rb +7 -13
  121. data/lib/elasticsearch/api/actions/tasks/get.rb +6 -3
  122. data/lib/elasticsearch/api/actions/tasks/list.rb +10 -16
  123. data/lib/elasticsearch/api/actions/termvectors.rb +22 -21
  124. data/lib/elasticsearch/api/actions/update.rb +19 -33
  125. data/lib/elasticsearch/api/actions/update_by_query.rb +13 -33
  126. data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +29 -0
  127. data/lib/elasticsearch/api/version.rb +1 -1
  128. data/spec/elasticsearch/api/actions/cluster/state_spec.rb +0 -17
  129. data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +17 -0
  130. data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +0 -37
  131. data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +0 -15
  132. data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +0 -15
  133. data/spec/elasticsearch/api/actions/indices/segments_spec.rb +0 -15
  134. data/spec/elasticsearch/api/actions/mget_spec.rb +0 -15
  135. data/spec/elasticsearch/api/actions/mlt_spec.rb +127 -114
  136. data/spec/elasticsearch/api/actions/search_exists_spec.rb +58 -12
  137. data/spec/elasticsearch/api/actions/search_spec.rb +0 -15
  138. data/test/integration/yaml_test_runner.rb +2 -4
  139. data/utils/thor/generate_source.rb +1 -0
  140. data/utils/thor/templates/ruby/method.erb +7 -5
  141. metadata +12 -10
  142. data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +0 -68
  143. data/spec/elasticsearch/api/actions/indices/stats_spec.rb +0 -108
  144. data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +0 -68
@@ -1,108 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'client.cluster#stats' do
4
-
5
- let(:expected_args) do
6
- [
7
- 'GET',
8
- url,
9
- params,
10
- body,
11
- nil
12
- ]
13
- end
14
-
15
- let(:url) do
16
- '_stats'
17
- end
18
-
19
- let(:body) do
20
- nil
21
- end
22
-
23
- let(:params) do
24
- {}
25
- end
26
-
27
- it 'performs the request' do
28
- expect(client_double.indices.stats).to eq({})
29
- end
30
-
31
- context 'when an index is specified' do
32
-
33
- let(:url) do
34
- 'foo/_stats'
35
- end
36
-
37
- it 'performs the request' do
38
- expect(client_double.indices.stats(index: 'foo')).to eq({})
39
- end
40
- end
41
-
42
- context 'when multiple indicies are specified as a list' do
43
-
44
- let(:url) do
45
- 'foo,bar/_stats'
46
- end
47
-
48
- it 'performs the request' do
49
- expect(client_double.indices.stats(index: ['foo', 'bar'])).to eq({})
50
- end
51
- end
52
-
53
- context 'when multiple indicies are specified as a string' do
54
-
55
- let(:url) do
56
- 'foo,bar/_stats'
57
- end
58
-
59
- it 'performs the request' do
60
- expect(client_double.indices.stats(index: 'foo,bar')).to eq({})
61
- end
62
- end
63
-
64
- context 'when parameters are specified' do
65
-
66
- let(:params) do
67
- { expand_wildcards: true }
68
- end
69
-
70
- let(:url) do
71
- 'foo/_stats'
72
- end
73
-
74
- it 'performs the request' do
75
- expect(client_double.indices.stats(index: 'foo', expand_wildcards: true)).to eq({})
76
- end
77
- end
78
-
79
- context 'when the fields parameter is specified as a list' do
80
-
81
- let(:params) do
82
- { fields: 'foo,bar' }
83
- end
84
-
85
- let(:url) do
86
- 'foo/_stats/fielddata'
87
- end
88
-
89
- it 'performs the request' do
90
- expect(client_double.indices.stats(index: 'foo', fielddata: true, fields: [ 'foo', 'bar'])).to eq({})
91
- end
92
- end
93
-
94
- context 'when the groups parameter is specified as a list' do
95
-
96
- let(:params) do
97
- { groups: 'groupA,groupB' }
98
- end
99
-
100
- let(:url) do
101
- '_stats/search'
102
- end
103
-
104
- it 'performs the request' do
105
- expect(client_double.indices.stats(search: true, groups: [ 'groupA', 'groupB'])).to eq({})
106
- end
107
- end
108
- end
@@ -1,68 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'client.indices#unfreeze' do
4
-
5
- let(:expected_args) do
6
- [
7
- 'POST',
8
- url,
9
- params,
10
- nil,
11
- nil
12
- ]
13
- end
14
-
15
- let(:params) do
16
- {}
17
- end
18
-
19
- context 'when there is no index specified' do
20
-
21
- let(:client) do
22
- Class.new { include Elasticsearch::API }.new
23
- end
24
-
25
- it 'raises an exception' do
26
- expect {
27
- client.indices.unfreeze
28
- }.to raise_exception(ArgumentError)
29
- end
30
- end
31
-
32
- context 'when an index is specified' do
33
-
34
- let(:url) do
35
- 'foo/_unfreeze'
36
- end
37
-
38
- it 'performs the request' do
39
- expect(client_double.indices.unfreeze(index: 'foo')).to eq({})
40
- end
41
- end
42
-
43
- context 'when params are specified' do
44
-
45
- let(:params) do
46
- { timeout: '1s' }
47
- end
48
-
49
- let(:url) do
50
- 'foo/_unfreeze'
51
- end
52
-
53
- it 'performs the request' do
54
- expect(client_double.indices.unfreeze(index: 'foo', timeout: '1s')).to eq({})
55
- end
56
- end
57
-
58
- context 'when the path must be URL-escaped' do
59
-
60
- let(:url) do
61
- 'foo%5Ebar/_unfreeze'
62
- end
63
-
64
- it 'performs the request' do
65
- expect(client_double.indices.unfreeze(index: 'foo^bar')).to eq({})
66
- end
67
- end
68
- end