elasticsearch-api 6.8.3 → 7.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (334) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +17 -1
  3. data/LICENSE.txt +199 -10
  4. data/README.md +3 -3
  5. data/Rakefile +23 -6
  6. data/elasticsearch-api.gemspec +77 -43
  7. data/lib/elasticsearch-api.rb +16 -3
  8. data/lib/elasticsearch/api.rb +18 -5
  9. data/lib/elasticsearch/api/actions/abort_benchmark.rb +17 -4
  10. data/lib/elasticsearch/api/actions/benchmark.rb +18 -5
  11. data/lib/elasticsearch/api/actions/bulk.rb +18 -7
  12. data/lib/elasticsearch/api/actions/cat/aliases.rb +25 -11
  13. data/lib/elasticsearch/api/actions/cat/allocation.rb +26 -12
  14. data/lib/elasticsearch/api/actions/cat/count.rb +25 -11
  15. data/lib/elasticsearch/api/actions/cat/fielddata.rb +23 -11
  16. data/lib/elasticsearch/api/actions/cat/health.rb +26 -12
  17. data/lib/elasticsearch/api/actions/cat/help.rb +18 -6
  18. data/lib/elasticsearch/api/actions/cat/indices.rb +28 -13
  19. data/lib/elasticsearch/api/actions/cat/master.rb +25 -11
  20. data/lib/elasticsearch/api/actions/cat/nodeattrs.rb +19 -7
  21. data/lib/elasticsearch/api/actions/cat/nodes.rb +25 -11
  22. data/lib/elasticsearch/api/actions/cat/params_registry.rb +19 -6
  23. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +25 -11
  24. data/lib/elasticsearch/api/actions/cat/plugins.rb +21 -8
  25. data/lib/elasticsearch/api/actions/cat/recovery.rb +26 -11
  26. data/lib/elasticsearch/api/actions/cat/repositories.rb +18 -7
  27. data/lib/elasticsearch/api/actions/cat/segments.rb +22 -10
  28. data/lib/elasticsearch/api/actions/cat/shards.rb +26 -12
  29. data/lib/elasticsearch/api/actions/cat/snapshots.rb +19 -9
  30. data/lib/elasticsearch/api/actions/cat/tasks.rb +20 -6
  31. data/lib/elasticsearch/api/actions/cat/templates.rb +21 -8
  32. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +33 -16
  33. data/lib/elasticsearch/api/actions/clear_scroll.rb +19 -15
  34. data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +20 -6
  35. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +19 -7
  36. data/lib/elasticsearch/api/actions/cluster/health.rb +35 -13
  37. data/lib/elasticsearch/api/actions/cluster/params_registry.rb +19 -6
  38. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +20 -6
  39. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +19 -8
  40. data/lib/elasticsearch/api/actions/cluster/remote_info.rb +17 -10
  41. data/lib/elasticsearch/api/actions/cluster/reroute.rb +23 -10
  42. data/lib/elasticsearch/api/actions/cluster/state.rb +28 -18
  43. data/lib/elasticsearch/api/actions/cluster/stats.rb +21 -16
  44. data/lib/elasticsearch/api/actions/count.rb +18 -4
  45. data/lib/elasticsearch/api/actions/create.rb +16 -3
  46. data/lib/elasticsearch/api/actions/delete.rb +24 -19
  47. data/lib/elasticsearch/api/actions/delete_by_query.rb +18 -5
  48. data/lib/elasticsearch/api/actions/{delete_by_query_rethrottle.rb → delete_by_rethrottle.rb} +18 -5
  49. data/lib/elasticsearch/api/actions/delete_script.rb +18 -5
  50. data/lib/elasticsearch/api/actions/exists.rb +18 -6
  51. data/lib/elasticsearch/api/actions/exists_source.rb +16 -3
  52. data/lib/elasticsearch/api/actions/explain.rb +30 -10
  53. data/lib/elasticsearch/api/actions/field_caps.rb +18 -6
  54. data/lib/elasticsearch/api/actions/get.rb +20 -6
  55. data/lib/elasticsearch/api/actions/get_script.rb +22 -9
  56. data/lib/elasticsearch/api/actions/get_source.rb +32 -10
  57. data/lib/elasticsearch/api/actions/index.rb +37 -17
  58. data/lib/elasticsearch/api/actions/indices/analyze.rb +32 -6
  59. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +20 -8
  60. data/lib/elasticsearch/api/actions/indices/close.rb +31 -11
  61. data/lib/elasticsearch/api/actions/indices/create.rb +36 -24
  62. data/lib/elasticsearch/api/actions/indices/delete.rb +21 -7
  63. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +20 -8
  64. data/lib/elasticsearch/api/actions/indices/delete_template.rb +18 -6
  65. data/lib/elasticsearch/api/actions/indices/exists.rb +32 -12
  66. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +30 -10
  67. data/lib/elasticsearch/api/actions/indices/exists_template.rb +20 -8
  68. data/lib/elasticsearch/api/actions/indices/exists_type.rb +31 -10
  69. data/lib/elasticsearch/api/actions/indices/flush.rb +26 -9
  70. data/lib/elasticsearch/api/actions/indices/flush_synced.rb +18 -5
  71. data/lib/elasticsearch/api/actions/indices/forcemerge.rb +18 -5
  72. data/lib/elasticsearch/api/actions/indices/freeze.rb +1 -4
  73. data/lib/elasticsearch/api/actions/indices/get.rb +21 -7
  74. data/lib/elasticsearch/api/actions/indices/get_alias.rb +18 -5
  75. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +21 -7
  76. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +21 -8
  77. data/lib/elasticsearch/api/actions/indices/get_settings.rb +18 -5
  78. data/lib/elasticsearch/api/actions/indices/get_template.rb +21 -7
  79. data/lib/elasticsearch/api/actions/indices/open.rb +18 -5
  80. data/lib/elasticsearch/api/actions/indices/params_registry.rb +19 -6
  81. data/lib/elasticsearch/api/actions/indices/put_alias.rb +18 -5
  82. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +23 -11
  83. data/lib/elasticsearch/api/actions/indices/put_settings.rb +18 -5
  84. data/lib/elasticsearch/api/actions/indices/put_template.rb +21 -7
  85. data/lib/elasticsearch/api/actions/indices/recovery.rb +19 -6
  86. data/lib/elasticsearch/api/actions/indices/refresh.rb +18 -5
  87. data/lib/elasticsearch/api/actions/indices/rollover.rb +21 -7
  88. data/lib/elasticsearch/api/actions/indices/segments.rb +18 -5
  89. data/lib/elasticsearch/api/actions/indices/shard_stores.rb +18 -5
  90. data/lib/elasticsearch/api/actions/indices/shrink.rb +18 -7
  91. data/lib/elasticsearch/api/actions/indices/split.rb +19 -9
  92. data/lib/elasticsearch/api/actions/indices/stats.rb +18 -5
  93. data/lib/elasticsearch/api/actions/indices/unfreeze.rb +0 -4
  94. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +18 -5
  95. data/lib/elasticsearch/api/actions/indices/upgrade.rb +18 -5
  96. data/lib/elasticsearch/api/actions/indices/validate_query.rb +18 -5
  97. data/lib/elasticsearch/api/actions/info.rb +16 -9
  98. data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +18 -5
  99. data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +20 -8
  100. data/lib/elasticsearch/api/actions/ingest/params_registry.rb +19 -6
  101. data/lib/elasticsearch/api/actions/ingest/processor_grok.rb +0 -4
  102. data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +18 -5
  103. data/lib/elasticsearch/api/actions/ingest/simulate.rb +22 -9
  104. data/lib/elasticsearch/api/actions/mget.rb +17 -4
  105. data/lib/elasticsearch/api/actions/msearch.rb +21 -7
  106. data/lib/elasticsearch/api/actions/msearch_template.rb +21 -6
  107. data/lib/elasticsearch/api/actions/mtermvectors.rb +18 -5
  108. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +20 -5
  109. data/lib/elasticsearch/api/actions/nodes/info.rb +44 -11
  110. data/lib/elasticsearch/api/actions/nodes/params_registry.rb +19 -6
  111. data/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +19 -12
  112. data/lib/elasticsearch/api/actions/nodes/shutdown.rb +17 -4
  113. data/lib/elasticsearch/api/actions/nodes/stats.rb +18 -5
  114. data/lib/elasticsearch/api/actions/nodes/usage.rb +3 -7
  115. data/lib/elasticsearch/api/actions/params_registry.rb +19 -6
  116. data/lib/elasticsearch/api/actions/ping.rb +16 -9
  117. data/lib/elasticsearch/api/actions/put_script.rb +18 -6
  118. data/lib/elasticsearch/api/actions/rank_eval.rb +17 -4
  119. data/lib/elasticsearch/api/actions/reindex.rb +19 -5
  120. data/lib/elasticsearch/api/actions/reindex_rethrottle.rb +17 -4
  121. data/lib/elasticsearch/api/actions/remote/info.rb +16 -3
  122. data/lib/elasticsearch/api/actions/render_search_template.rb +18 -5
  123. data/lib/elasticsearch/api/actions/scripts_painless_execute.rb +16 -9
  124. data/lib/elasticsearch/api/actions/scroll.rb +19 -6
  125. data/lib/elasticsearch/api/actions/search.rb +72 -39
  126. data/lib/elasticsearch/api/actions/search_shards.rb +31 -11
  127. data/lib/elasticsearch/api/actions/search_template.rb +21 -6
  128. data/lib/elasticsearch/api/actions/snapshot/create.rb +20 -6
  129. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +18 -5
  130. data/lib/elasticsearch/api/actions/snapshot/delete.rb +20 -7
  131. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +19 -5
  132. data/lib/elasticsearch/api/actions/snapshot/get.rb +21 -7
  133. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +23 -7
  134. data/lib/elasticsearch/api/actions/snapshot/params_registry.rb +19 -6
  135. data/lib/elasticsearch/api/actions/snapshot/restore.rb +18 -5
  136. data/lib/elasticsearch/api/actions/snapshot/status.rb +23 -8
  137. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +18 -5
  138. data/lib/elasticsearch/api/actions/tasks/cancel.rb +18 -5
  139. data/lib/elasticsearch/api/actions/tasks/get.rb +18 -5
  140. data/lib/elasticsearch/api/actions/tasks/list.rb +18 -5
  141. data/lib/elasticsearch/api/actions/tasks/params_registry.rb +19 -6
  142. data/lib/elasticsearch/api/actions/termvectors.rb +33 -18
  143. data/lib/elasticsearch/api/actions/update.rb +61 -26
  144. data/lib/elasticsearch/api/actions/update_by_query.rb +18 -5
  145. data/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +16 -3
  146. data/lib/elasticsearch/api/namespace/cat.rb +16 -3
  147. data/lib/elasticsearch/api/namespace/cluster.rb +16 -3
  148. data/lib/elasticsearch/api/namespace/common.rb +16 -3
  149. data/lib/elasticsearch/api/namespace/indices.rb +16 -3
  150. data/lib/elasticsearch/api/namespace/ingest.rb +16 -3
  151. data/lib/elasticsearch/api/namespace/nodes.rb +16 -3
  152. data/lib/elasticsearch/api/namespace/remote.rb +16 -3
  153. data/lib/elasticsearch/api/namespace/snapshot.rb +16 -3
  154. data/lib/elasticsearch/api/namespace/tasks.rb +16 -3
  155. data/lib/elasticsearch/api/utils.rb +16 -3
  156. data/lib/elasticsearch/api/version.rb +17 -4
  157. data/spec/elasticsearch/api/actions/abort_benchmark_spec.rb +16 -3
  158. data/spec/elasticsearch/api/actions/benchmark_spec.rb +16 -3
  159. data/spec/elasticsearch/api/actions/bulk_spec.rb +16 -3
  160. data/spec/elasticsearch/api/actions/cat/aliases_spec.rb +16 -3
  161. data/spec/elasticsearch/api/actions/cat/allocation_spec.rb +16 -3
  162. data/spec/elasticsearch/api/actions/cat/count_spec.rb +16 -3
  163. data/spec/elasticsearch/api/actions/cat/fielddata_spec.rb +16 -3
  164. data/spec/elasticsearch/api/actions/cat/health_spec.rb +16 -3
  165. data/spec/elasticsearch/api/actions/cat/help_spec.rb +16 -3
  166. data/spec/elasticsearch/api/actions/cat/indices_spec.rb +16 -3
  167. data/spec/elasticsearch/api/actions/cat/master_spec.rb +16 -3
  168. data/spec/elasticsearch/api/actions/cat/nodeattrs_spec.rb +16 -3
  169. data/spec/elasticsearch/api/actions/cat/nodes_spec.rb +16 -3
  170. data/spec/elasticsearch/api/actions/cat/pending_tasks_spec.rb +16 -3
  171. data/spec/elasticsearch/api/actions/cat/plugins_spec.rb +16 -3
  172. data/spec/elasticsearch/api/actions/cat/recovery_spec.rb +16 -3
  173. data/spec/elasticsearch/api/actions/cat/repositories_spec.rb +16 -3
  174. data/spec/elasticsearch/api/actions/cat/segments_spec.rb +33 -4
  175. data/spec/elasticsearch/api/actions/cat/shards_spec.rb +16 -3
  176. data/spec/elasticsearch/api/actions/cat/snapshot_spec.rb +16 -3
  177. data/spec/elasticsearch/api/actions/cat/tasks_spec.rb +16 -3
  178. data/spec/elasticsearch/api/actions/cat/templates_spec.rb +16 -3
  179. data/spec/elasticsearch/api/actions/cat/thread_pool_spec.rb +16 -3
  180. data/spec/elasticsearch/api/actions/clear_scroll_spec.rb +16 -3
  181. data/spec/elasticsearch/api/actions/cluster/allocation_explain_spec.rb +16 -3
  182. data/spec/elasticsearch/api/actions/cluster/get_settings_spec.rb +16 -3
  183. data/spec/elasticsearch/api/actions/cluster/health_spec.rb +16 -3
  184. data/spec/elasticsearch/api/actions/cluster/pending_tasks_spec.rb +16 -3
  185. data/spec/elasticsearch/api/actions/cluster/put_settings_spec.rb +16 -3
  186. data/spec/elasticsearch/api/actions/cluster/remote_info_spec.rb +16 -3
  187. data/spec/elasticsearch/api/actions/cluster/reroute_spec.rb +16 -3
  188. data/spec/elasticsearch/api/actions/cluster/state_spec.rb +16 -3
  189. data/spec/elasticsearch/api/actions/cluster/stats_spec.rb +16 -20
  190. data/spec/elasticsearch/api/actions/count_spec.rb +16 -3
  191. data/spec/elasticsearch/api/actions/create_document_spec.rb +16 -3
  192. data/spec/elasticsearch/api/actions/delete_by_query_spec.rb +16 -3
  193. data/spec/elasticsearch/api/actions/delete_document_spec.rb +16 -9
  194. data/spec/elasticsearch/api/actions/delete_script_spec.rb +16 -3
  195. data/spec/elasticsearch/api/actions/exists_document_spec.rb +16 -3
  196. data/spec/elasticsearch/api/actions/explain_document_spec.rb +17 -10
  197. data/spec/elasticsearch/api/actions/field_caps_spec.rb +16 -3
  198. data/spec/elasticsearch/api/actions/get_document_source_spec.rb +17 -4
  199. data/spec/elasticsearch/api/actions/get_document_spec.rb +17 -4
  200. data/spec/elasticsearch/api/actions/get_script_spec.rb +22 -16
  201. data/spec/elasticsearch/api/actions/hashie_spec.rb +16 -3
  202. data/spec/elasticsearch/api/actions/index_document_spec.rb +16 -9
  203. data/spec/elasticsearch/api/actions/indices/analyze_spec.rb +16 -3
  204. data/spec/elasticsearch/api/actions/indices/clear_cache_spec.rb +19 -6
  205. data/spec/elasticsearch/api/actions/indices/close_spec.rb +16 -3
  206. data/spec/elasticsearch/api/actions/indices/create_spec.rb +16 -3
  207. data/spec/elasticsearch/api/actions/indices/delete_alias_spec.rb +16 -3
  208. data/spec/elasticsearch/api/actions/indices/delete_spec.rb +16 -3
  209. data/spec/elasticsearch/api/actions/indices/delete_template_spec.rb +16 -3
  210. data/spec/elasticsearch/api/actions/indices/exists_alias_spec.rb +16 -3
  211. data/spec/elasticsearch/api/actions/indices/exists_spec.rb +16 -3
  212. data/spec/elasticsearch/api/actions/indices/exists_template_spec.rb +16 -3
  213. data/spec/elasticsearch/api/actions/indices/exists_type_spec.rb +16 -3
  214. data/spec/elasticsearch/api/actions/indices/flush_spec.rb +16 -3
  215. data/spec/elasticsearch/api/actions/indices/flush_synced_spec.rb +16 -3
  216. data/spec/elasticsearch/api/actions/indices/forcemerge_spec.rb +16 -3
  217. data/spec/elasticsearch/api/actions/indices/freeze_spec.rb +68 -0
  218. data/spec/elasticsearch/api/actions/indices/get_alias_spec.rb +16 -3
  219. data/spec/elasticsearch/api/actions/indices/get_field_mapping_spec.rb +16 -3
  220. data/spec/elasticsearch/api/actions/indices/get_mapping_spec.rb +16 -3
  221. data/spec/elasticsearch/api/actions/indices/get_settings_spec.rb +16 -3
  222. data/spec/elasticsearch/api/actions/indices/get_spec.rb +16 -3
  223. data/spec/elasticsearch/api/actions/indices/open_spec.rb +16 -3
  224. data/spec/elasticsearch/api/actions/indices/put_alias_spec.rb +16 -3
  225. data/spec/elasticsearch/api/actions/indices/put_mapping_spec.rb +16 -3
  226. data/spec/elasticsearch/api/actions/indices/put_settings_spec.rb +31 -3
  227. data/spec/elasticsearch/api/actions/indices/put_template_spec.rb +16 -3
  228. data/spec/elasticsearch/api/actions/indices/recovery_spec.rb +16 -3
  229. data/spec/elasticsearch/api/actions/indices/refresh_spec.rb +16 -3
  230. data/spec/elasticsearch/api/actions/indices/rollover_spec.rb +16 -3
  231. data/spec/elasticsearch/api/actions/indices/segments_spec.rb +16 -3
  232. data/spec/elasticsearch/api/actions/indices/shard_stores_spec.rb +16 -3
  233. data/spec/elasticsearch/api/actions/indices/shrink_spec.rb +16 -3
  234. data/spec/elasticsearch/api/actions/indices/split_spec.rb +16 -3
  235. data/spec/elasticsearch/api/actions/indices/stats_spec.rb +125 -0
  236. data/spec/elasticsearch/api/actions/indices/unfreeze_spec.rb +68 -0
  237. data/spec/elasticsearch/api/actions/indices/update_aliases_spec.rb +16 -3
  238. data/spec/elasticsearch/api/actions/indices/upgrade_spec.rb +16 -3
  239. data/spec/elasticsearch/api/actions/indices/validate_query_spec.rb +16 -3
  240. data/spec/elasticsearch/api/actions/info_spec.rb +16 -3
  241. data/spec/elasticsearch/api/actions/ingest/delete_pipeline_spec.rb +16 -3
  242. data/spec/elasticsearch/api/actions/ingest/get_pipeline_spec.rb +16 -3
  243. data/spec/elasticsearch/api/actions/ingest/put_pipeline_spec.rb +16 -3
  244. data/spec/elasticsearch/api/actions/ingest/simulate_spec.rb +16 -3
  245. data/spec/elasticsearch/api/actions/json_builders_spec.rb +16 -3
  246. data/spec/elasticsearch/api/actions/mget_spec.rb +16 -3
  247. data/spec/elasticsearch/api/actions/msearch_spec.rb +16 -3
  248. data/spec/elasticsearch/api/actions/msearch_template_spec.rb +16 -3
  249. data/spec/elasticsearch/api/actions/mtermvectors_spec.rb +16 -3
  250. data/spec/elasticsearch/api/actions/nodes/hot_threads_spec.rb +16 -3
  251. data/spec/elasticsearch/api/actions/nodes/info_spec.rb +16 -3
  252. data/spec/elasticsearch/api/actions/nodes/reload_secure_settings_spec.rb +16 -3
  253. data/spec/elasticsearch/api/actions/nodes/shutdown_spec.rb +16 -3
  254. data/spec/elasticsearch/api/actions/nodes/stats_spec.rb +16 -3
  255. data/spec/elasticsearch/api/actions/ping_spec.rb +16 -3
  256. data/spec/elasticsearch/api/actions/put_script_spec.rb +16 -3
  257. data/spec/elasticsearch/api/actions/reindex_spec.rb +16 -3
  258. data/spec/elasticsearch/api/actions/remote/info_spec.rb +16 -3
  259. data/spec/elasticsearch/api/actions/render_search_template_spec.rb +16 -3
  260. data/spec/elasticsearch/api/actions/scoll_spec.rb +16 -3
  261. data/spec/elasticsearch/api/actions/search_shards_spec.rb +16 -3
  262. data/spec/elasticsearch/api/actions/search_spec.rb +31 -3
  263. data/spec/elasticsearch/api/actions/search_template_spec.rb +16 -3
  264. data/spec/elasticsearch/api/actions/snapshot/create_repository_spec.rb +16 -3
  265. data/spec/elasticsearch/api/actions/snapshot/create_spec.rb +16 -3
  266. data/spec/elasticsearch/api/actions/snapshot/delete_repository_spec.rb +16 -3
  267. data/spec/elasticsearch/api/actions/snapshot/delete_spec.rb +16 -3
  268. data/spec/elasticsearch/api/actions/snapshot/get_repository_spec.rb +16 -3
  269. data/spec/elasticsearch/api/actions/snapshot/get_spec.rb +16 -3
  270. data/spec/elasticsearch/api/actions/snapshot/restore_spec.rb +16 -3
  271. data/spec/elasticsearch/api/actions/snapshot/status_spec.rb +16 -3
  272. data/spec/elasticsearch/api/actions/snapshot/verify_repository_spec.rb +16 -3
  273. data/spec/elasticsearch/api/actions/tasks/cancel_spec.rb +16 -3
  274. data/spec/elasticsearch/api/actions/tasks/get_spec.rb +16 -3
  275. data/spec/elasticsearch/api/actions/tasks/list_spec.rb +16 -3
  276. data/spec/elasticsearch/api/actions/termvectors_spec.rb +16 -9
  277. data/spec/elasticsearch/api/actions/update_by_query_spec.rb +16 -3
  278. data/spec/elasticsearch/api/actions/update_document_spec.rb +16 -9
  279. data/spec/elasticsearch/api/api_spec.rb +16 -3
  280. data/spec/elasticsearch/api/client_spec.rb +16 -3
  281. data/spec/elasticsearch/api/utils_spec.rb +16 -3
  282. data/spec/spec_helper.rb +16 -14
  283. data/test/integration/yaml_test_runner.rb +84 -42
  284. data/test/test_helper.rb +86 -14
  285. data/utils/Gemfile +17 -0
  286. data/utils/Thorfile +17 -0
  287. data/utils/thor/generate_api.rb +16 -3
  288. data/utils/thor/generate_source.rb +22 -6
  289. data/utils/thor/lister.rb +16 -3
  290. data/utils/thor/templates/ruby/method.erb +22 -7
  291. data/utils/thor/templates/ruby/test.erb +17 -0
  292. data/utils/thor/templates/ruby/test_helper.rb +16 -4
  293. metadata +56 -122
  294. data/lib/elasticsearch/api/actions/count_percolate.rb +0 -86
  295. data/lib/elasticsearch/api/actions/delete_template.rb +0 -25
  296. data/lib/elasticsearch/api/actions/field_stats.rb +0 -40
  297. data/lib/elasticsearch/api/actions/get_template.rb +0 -31
  298. data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +0 -30
  299. data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +0 -36
  300. data/lib/elasticsearch/api/actions/indices/get_aliases.rb +0 -41
  301. data/lib/elasticsearch/api/actions/indices/get_warmer.rb +0 -66
  302. data/lib/elasticsearch/api/actions/indices/optimize.rb +0 -81
  303. data/lib/elasticsearch/api/actions/indices/put_warmer.rb +0 -69
  304. data/lib/elasticsearch/api/actions/indices/seal.rb +0 -28
  305. data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +0 -48
  306. data/lib/elasticsearch/api/actions/indices/status.rb +0 -67
  307. data/lib/elasticsearch/api/actions/list_benchmarks.rb +0 -31
  308. data/lib/elasticsearch/api/actions/mlt.rb +0 -134
  309. data/lib/elasticsearch/api/actions/mpercolate.rb +0 -66
  310. data/lib/elasticsearch/api/actions/percolate.rb +0 -77
  311. data/lib/elasticsearch/api/actions/put_template.rb +0 -29
  312. data/lib/elasticsearch/api/actions/search_exists.rb +0 -67
  313. data/lib/elasticsearch/api/actions/suggest.rb +0 -53
  314. data/spec/elasticsearch/api/actions/count_percolate_spec.rb +0 -21
  315. data/spec/elasticsearch/api/actions/delete_template_spec.rb +0 -21
  316. data/spec/elasticsearch/api/actions/field_stats_spec.rb +0 -21
  317. data/spec/elasticsearch/api/actions/get_template_spec.rb +0 -56
  318. data/spec/elasticsearch/api/actions/indices/delete_mapping_spec.rb +0 -81
  319. data/spec/elasticsearch/api/actions/indices/delete_warmer_spec.rb +0 -90
  320. data/spec/elasticsearch/api/actions/indices/get_aliases_spec.rb +0 -59
  321. data/spec/elasticsearch/api/actions/indices/get_template_spec.rb +0 -63
  322. data/spec/elasticsearch/api/actions/indices/get_warmer_spec.rb +0 -52
  323. data/spec/elasticsearch/api/actions/indices/optimize_spec.rb +0 -67
  324. data/spec/elasticsearch/api/actions/indices/put_warmer_spec.rb +0 -105
  325. data/spec/elasticsearch/api/actions/indices/seal_spec.rb +0 -22
  326. data/spec/elasticsearch/api/actions/indices/snapshot_index_spec.rb +0 -93
  327. data/spec/elasticsearch/api/actions/indices/status_spec.rb +0 -96
  328. data/spec/elasticsearch/api/actions/list_benchmarks_spec.rb +0 -21
  329. data/spec/elasticsearch/api/actions/mlt_spec.rb +0 -134
  330. data/spec/elasticsearch/api/actions/mpercolate_spec.rb +0 -53
  331. data/spec/elasticsearch/api/actions/put_template_spec.rb +0 -21
  332. data/spec/elasticsearch/api/actions/rank_eval_spec.rb +0 -113
  333. data/spec/elasticsearch/api/actions/search_exists_spec.rb +0 -67
  334. data/spec/elasticsearch/api/actions/suggest_spec.rb +0 -81
@@ -1,86 +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 the number of queries matching a document.
10
- #
11
- # Percolator allows you to register queries and then evaluate a document against them:
12
- # the number of matching queries is returned in the response.
13
- #
14
- # @example Register query named "alert-1" for the "my-index" index
15
- #
16
- # client.index index: 'my-index',
17
- # type: '.percolator',
18
- # id: 'alert-1',
19
- # body: { query: { query_string: { query: 'foo' } } }
20
- #
21
- # @example Return the number of matching queries for a custom document
22
- #
23
- # client.count_percolate index: 'my-index', type: 'my-type', body: { doc: { title: "Foo Bar" } }
24
- # # => { ..., total: 1}
25
- #
26
- # @example Return the number of matching queries for an existing document
27
- #
28
- # client.index index: 'my-index', type: 'my-type', id: '123', body: { title: "Foo Bar" }
29
- #
30
- # client.count_percolate index: 'my-index', type: 'my-type', id: '123'
31
- # # => { ..., total: 1}
32
- #
33
- # @option arguments [String] :index The index of the document being percolated. (*Required*)
34
- # @option arguments [String] :type The type of the document being percolated. (*Required*)
35
- # @option arguments [String] :id Fetch the document specified by index/type/id and
36
- # use it instead of the passed `doc`
37
- # @option arguments [Hash] :body The percolator request definition using the percolate DSL
38
- # @option arguments [List] :routing A comma-separated list of specific routing values
39
- # @option arguments [String] :preference Specify the node or shard the operation should be performed on
40
- # (default: random)
41
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
42
- # unavailable (missing or closed)
43
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
44
- # no concrete indices. (This includes `_all` string or when no
45
- # indices have been specified)
46
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are
47
- # open, closed or both. (options: open, closed)
48
- # @option arguments [String] :percolate_index The index to percolate the document into. Defaults to passed `index`.
49
- # @option arguments [String] :percolate_type The type to percolate document into. Defaults to passed `type`.
50
- # @option arguments [Number] :version Explicit version number for concurrency control
51
- # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte, force)
52
- #
53
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-percolate.html
54
- #
55
- def count_percolate(arguments={})
56
- raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
57
- raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
58
-
59
- method = HTTP_GET
60
- path = Utils.__pathify Utils.__escape(arguments[:index]),
61
- Utils.__escape(arguments[:type]),
62
- arguments[:id],
63
- '_percolate/count'
64
-
65
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
66
- body = arguments[:body]
67
-
68
- perform_request(method, path, params, body).body
69
- end
70
-
71
- # Register this action with its valid params when the module is loaded.
72
- #
73
- # @since 6.2.0
74
- ParamsRegistry.register(:count_percolate, [
75
- :routing,
76
- :preference,
77
- :ignore_unavailable,
78
- :allow_no_indices,
79
- :expand_wildcards,
80
- :percolate_index,
81
- :percolate_type,
82
- :version,
83
- :version_type ].freeze)
84
- end
85
- end
86
- end
@@ -1,25 +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
- # Retrieve an indexed template from Elasticsearch
10
- #
11
- # @option arguments [String] :id Template ID
12
- #
13
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
14
- #
15
- def delete_template(arguments={})
16
- method = HTTP_DELETE
17
- path = "_search/template/#{arguments[:id]}"
18
- params = {}
19
- body = nil
20
-
21
- perform_request(method, path, params, body).body
22
- end
23
- end
24
- end
25
- end
@@ -1,40 +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
- # Returns statistical information about a field without executing a search.
10
- #
11
- # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
12
- # @option arguments [List] :fields A comma-separated list of fields for to get field statistics for (min value, max value, and more)
13
- # @option arguments [String] :level Defines if field stats should be returned on a per index level or on a cluster wide level (options: indices, cluster)
14
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
15
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
16
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, none, all)
17
- #
18
- # @see http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-stats.html
19
- #
20
- def field_stats(arguments={})
21
- method = 'GET'
22
- path = Utils.__pathify Utils.__escape(arguments[:index]), "_field_stats"
23
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
24
- body = arguments[:body]
25
-
26
- perform_request(method, path, params, body).body
27
- end
28
-
29
- # Register this action with its valid params when the module is loaded.
30
- #
31
- # @since 6.2.0
32
- ParamsRegistry.register(:field_stats, [
33
- :fields,
34
- :level,
35
- :ignore_unavailable,
36
- :allow_no_indices,
37
- :expand_wildcards ].freeze)
38
- end
39
- end
40
- 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
- # Retrieve an indexed script from Elasticsearch
10
- #
11
- # @option arguments [String] :id Template ID (*Required*)
12
- # @option arguments [Hash] :body The document
13
- #
14
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
15
- #
16
- def get_template(arguments={})
17
- raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
18
- method = HTTP_GET
19
- path = "_scripts/#{arguments[:id]}"
20
- params = {}
21
- body = arguments[:body]
22
-
23
- if Array(arguments[:ignore]).include?(404)
24
- Utils.__rescue_from_not_found { perform_request(method, path, params, body).body }
25
- else
26
- perform_request(method, path, params, body).body
27
- end
28
- end
29
- end
30
- end
31
- end
@@ -1,30 +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
- # Delete all documents and mapping for a specific document type.
11
- #
12
- # @option arguments [List] :index A comma-separated list of index names; use `_all` for all indices (*Required*)
13
- # @option arguments [String] :type The name of the document type to delete (*Required*)
14
- #
15
- # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-delete-mapping/
16
- #
17
- def delete_mapping(arguments={})
18
- raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
19
- raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
20
- method = HTTP_DELETE
21
- path = Utils.__pathify Utils.__listify(arguments[:index]), Utils.__escape(arguments[:type])
22
- params = {}
23
- body = nil
24
-
25
- perform_request(method, path, params, body).body
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,36 +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
- # Delete one or more warmers for a list of indices.
11
- #
12
- # @example Delete a warmer named _mywarmer_ for index named _myindex_
13
- #
14
- # client.indices.delete_warmer index: 'myindex', name: 'mywarmer'
15
- #
16
- # @option arguments [List] :index A comma-separated list of index names to register warmer for; use `_all`
17
- # or empty string to perform the operation on all indices (*Required*)
18
- # @option arguments [String] :name The name of the warmer (supports wildcards); leave empty to delete all warmers
19
- # @option arguments [List] :type A comma-separated list of document types to register warmer for; use `_all`
20
- # or empty string to perform the operation on all types
21
- #
22
- # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/
23
- #
24
- def delete_warmer(arguments={})
25
- raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
26
- method = HTTP_DELETE
27
- path = Utils.__pathify Utils.__listify(arguments[:index]), '_warmer', Utils.__listify(arguments[:name])
28
- params = {}
29
- body = nil
30
-
31
- perform_request(method, path, params, body).body
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,41 +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
- # Get a list of all aliases, or aliases for a specific index.
11
- #
12
- # @example Get a list of all aliases
13
- #
14
- # client.indices.get_aliases
15
- #
16
- # @option arguments [List] :index A comma-separated list of index names to filter aliases
17
- # @option arguments [List] :name A comma-separated list of alias names to filter
18
- # @option arguments [Time] :timeout Explicit timestamp for the document
19
- # @option arguments [Boolean] :local Return local information,
20
- # do not retrieve the state from master node (default: false)
21
- #
22
- # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html
23
- #
24
- def get_aliases(arguments={})
25
- method = HTTP_GET
26
- path = Utils.__pathify Utils.__listify(arguments[:index]), '_aliases', Utils.__listify(arguments[:name])
27
-
28
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
29
- body = nil
30
-
31
- perform_request(method, path, params, body).body
32
- end
33
-
34
- # Register this action with its valid params when the module is loaded.
35
- #
36
- # @since 6.2.0
37
- ParamsRegistry.register(:get_aliases, [ :timeout, :local ].freeze)
38
- end
39
- end
40
- end
41
- 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 Indices
8
- module Actions
9
-
10
- # Get one or more warmers for an index.
11
- #
12
- # @example Get all warmers
13
- #
14
- # client.indices.get_warmer index: '_all'
15
- #
16
- # @example Get all warmers matching a wildcard expression
17
- #
18
- # client.indices.get_warmer index: '_all', name: 'ba*'
19
- #
20
- # @example Get all warmers for a single index
21
- #
22
- # client.indices.get_warmer index: 'foo'
23
- #
24
- # @example Get a specific warmer
25
- #
26
- # client.indices.get_warmer index: 'foo', name: 'bar'
27
- #
28
- # @option arguments [List] :index A comma-separated list of index names to restrict the operation;
29
- # use `_all` to perform the operation on all indices (*Required*)
30
- # @option arguments [String] :name The name of the warmer (supports wildcards); leave empty to get all warmers
31
- # @option arguments [List] :type A comma-separated list of document types to restrict the operation;
32
- # leave empty to perform the operation on all types
33
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
34
- # no concrete indices. (This includes `_all` string or when no
35
- # indices have been specified)
36
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that
37
- # are open, closed or both. (options: open, closed)
38
- # @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore
39
- # `missing` ones (options: none, missing) @until 1.0
40
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
41
- # unavailable (missing, closed, etc)
42
- #
43
- # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-warmers/
44
- #
45
- def get_warmer(arguments={})
46
- method = HTTP_GET
47
- path = Utils.__pathify( Utils.__listify(arguments[:index]), '_warmer', Utils.__escape(arguments[:name]) )
48
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
49
- body = nil
50
-
51
- perform_request(method, path, params, body).body
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(:get_warmer, [
58
- :ignore_indices,
59
- :ignore_unavailable,
60
- :allow_no_indices,
61
- :expand_wildcards,
62
- :local ].freeze)
63
- end
64
- end
65
- end
66
- 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
- module Elasticsearch
6
- module API
7
- module Indices
8
- module Actions
9
-
10
- # Perform an index optimization.
11
- #
12
- # The "optimize" operation merges the index segments, increasing search performance.
13
- # It corresponds to a Lucene "merge" operation.
14
- #
15
- # @deprecated The "optimize" action has been deprecated in favor of forcemerge [https://github.com/elastic/elasticsearch/pull/13778]
16
- #
17
- # @example Fully optimize an index (merge to one segment)
18
- #
19
- # client.indices.optimize index: 'foo', max_num_segments: 1, wait_for_merge: false
20
- #
21
- # @note The optimize operation is handled automatically by Elasticsearch, you don't need to perform it manually.
22
- # The operation is expensive in terms of resources (I/O, CPU, memory) and can take a long time to
23
- # finish, potentially reducing operability of your cluster; schedule the manual optimization accordingly.
24
- #
25
- # @option arguments [List] :index A comma-separated list of index names; use `_all`
26
- # or empty string to perform the operation on all indices
27
- # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into
28
- # no concrete indices. (This includes `_all` string or when no
29
- # indices have been specified)
30
- # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that
31
- # are open, closed or both. (options: open, closed)
32
- # @option arguments [Boolean] :flush Specify whether the index should be flushed after performing the operation
33
- # (default: true)
34
- # @option arguments [Boolean] :force Force a merge operation to run, even when the index has a single segment
35
- # (default: true)
36
- # @option arguments [String] :ignore_indices When performed on multiple indices, allows to ignore
37
- # `missing` ones (options: none, missing) @until 1.0
38
- # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when
39
- # unavailable (missing, closed, etc)
40
- # @option arguments [Number] :max_num_segments The number of segments the index should be merged into
41
- # (default: dynamic)
42
- # @option arguments [Time] :master_timeout Specify timeout for connection to master
43
- # @option arguments [Boolean] :only_expunge_deletes Specify whether the operation should only expunge
44
- # deleted documents
45
- # @option arguments [Boolean] :refresh Specify whether the index should be refreshed after performing the operation
46
- # (default: true)
47
- # @option arguments [Boolean] :wait_for_merge Specify whether the request should block until the merge process
48
- # is finished (default: true)
49
- #
50
- # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-optimize/
51
- #
52
- def optimize(arguments={})
53
- method = HTTP_POST
54
- path = Utils.__pathify Utils.__listify(arguments[:index]), '_optimize'
55
-
56
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
57
- body = nil
58
-
59
- perform_request(method, path, params, body).body
60
- end
61
-
62
- # Register this action with its valid params when the module is loaded.
63
- #
64
- # @since 6.2.0
65
- ParamsRegistry.register(:optimize, [
66
- :ignore_indices,
67
- :ignore_unavailable,
68
- :allow_no_indices,
69
- :expand_wildcards,
70
- :flush,
71
- :force,
72
- :master_timeout,
73
- :max_num_segments,
74
- :only_expunge_deletes,
75
- :operation_threading,
76
- :refresh,
77
- :wait_for_merge ].freeze)
78
- end
79
- end
80
- end
81
- end