elastics-client 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/LICENSE +20 -0
  2. data/README.md +28 -0
  3. data/VERSION +1 -0
  4. data/elastics-client.gemspec +33 -0
  5. data/lib/elastics.rb +108 -0
  6. data/lib/elastics/api_stubs.rb +1268 -0
  7. data/lib/elastics/api_templates/cluster_api.yml +94 -0
  8. data/lib/elastics/api_templates/core_api.yml +202 -0
  9. data/lib/elastics/api_templates/indices_api.yml +304 -0
  10. data/lib/elastics/class_proxy/base.rb +29 -0
  11. data/lib/elastics/class_proxy/templates.rb +97 -0
  12. data/lib/elastics/class_proxy/templates/doc.rb +91 -0
  13. data/lib/elastics/class_proxy/templates/search.rb +72 -0
  14. data/lib/elastics/configuration.rb +25 -0
  15. data/lib/elastics/deprecation.rb +153 -0
  16. data/lib/elastics/errors.rb +43 -0
  17. data/lib/elastics/http_clients/base.rb +15 -0
  18. data/lib/elastics/http_clients/loader.rb +51 -0
  19. data/lib/elastics/http_clients/patron.rb +29 -0
  20. data/lib/elastics/http_clients/rest_client.rb +36 -0
  21. data/lib/elastics/logger.rb +37 -0
  22. data/lib/elastics/prog_bar.rb +39 -0
  23. data/lib/elastics/rails.rb +1 -0
  24. data/lib/elastics/result.rb +24 -0
  25. data/lib/elastics/result/bulk.rb +20 -0
  26. data/lib/elastics/result/document.rb +67 -0
  27. data/lib/elastics/result/multi_get.rb +24 -0
  28. data/lib/elastics/result/search.rb +28 -0
  29. data/lib/elastics/struct/array.rb +25 -0
  30. data/lib/elastics/struct/hash.rb +105 -0
  31. data/lib/elastics/struct/paginable.rb +58 -0
  32. data/lib/elastics/struct/prunable.rb +60 -0
  33. data/lib/elastics/struct/symbolize.rb +27 -0
  34. data/lib/elastics/tasks.rb +62 -0
  35. data/lib/elastics/template.rb +124 -0
  36. data/lib/elastics/template/common.rb +42 -0
  37. data/lib/elastics/template/logger.rb +66 -0
  38. data/lib/elastics/template/partial.rb +28 -0
  39. data/lib/elastics/template/search.rb +30 -0
  40. data/lib/elastics/template/slim_search.rb +13 -0
  41. data/lib/elastics/template/tags.rb +56 -0
  42. data/lib/elastics/templates.rb +20 -0
  43. data/lib/elastics/utility_methods.rb +131 -0
  44. data/lib/elastics/utils.rb +103 -0
  45. data/lib/elastics/variables.rb +62 -0
  46. data/lib/tasks.rake +28 -0
  47. metadata +148 -0
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012-2013 by Domizio Demichelis
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,28 @@
1
+ # elastics-client
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/elastics-client.png)](http://badge.fury.io/rb/elastics-client)
4
+
5
+ Provides the core infrastructure and the lower level functionality:
6
+
7
+ * HTTP clients
8
+ * elasticsearch API methods
9
+ * Templating System
10
+ * Cascading Variables Management
11
+ * Result Extenders
12
+ * Logging & Debugging
13
+ * Self-documenting tool
14
+ * Rake Tasks
15
+
16
+ ## Links
17
+
18
+ - __Gem-Specific Documentation__
19
+ - [elastics-client](http://elastics.github.io/elastics/doc/2-elastics-client)
20
+
21
+ ## Credits
22
+
23
+ Special thanks for their sponsorship to [Escalate Media](http://www.escalatemedia.com) and [Barquin International](http://www.barquin.com).
24
+
25
+ ## Copyright
26
+
27
+ Copyright (c) 2012-2013 by [Domizio Demichelis](mailto://dd.nexus@gmail.com)<br>
28
+ See [LICENSE](https://github.com/elastics/elastics/blob/master/elastics-client/LICENSE) for details.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.4
@@ -0,0 +1,33 @@
1
+ require 'date'
2
+ version = File.read(File.expand_path('../VERSION', __FILE__)).strip
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'elastics-client'
6
+ s.summary = 'Client gem for elasticsearch'
7
+ s.description = 'Core gem used by all the elastics gems.'
8
+ s.homepage = 'http://elastics.github.io/elastics'
9
+ s.authors = ['Domizio Demichelis']
10
+ s.email = 'dd.nexus@gmail.com'
11
+ s.require_paths = %w[lib]
12
+ s.files = `git ls-files -z`.split("\0")
13
+ s.version = version
14
+ s.date = Date.today.to_s
15
+ s.required_rubygems_version = '>= 1.3.6'
16
+ s.rdoc_options = %w[--charset=UTF-8]
17
+ s.license = 'MIT'
18
+ s.post_install_message = <<EOM
19
+ ________________________________________________________________________________
20
+
21
+ ELASTICS INSTALLATION NOTES
22
+ ________________________________________________________________________________
23
+
24
+ New Documentation: http://elastics.github.io/elastics
25
+
26
+ Upgrading Tutorial: http://elastics.github.io/elastics/doc/7-Tutorials/2-Migrate-from-0.x.html
27
+
28
+ ________________________________________________________________________________
29
+ EOM
30
+ s.add_runtime_dependency 'multi_json', '>= 1.3.4'
31
+ s.add_runtime_dependency 'progressbar', '>= 0.11.0', '~> 0.12.0'
32
+ s.add_runtime_dependency 'dye', '~> 0.1.4'
33
+ end
@@ -0,0 +1,108 @@
1
+ require 'dye'
2
+ require 'yaml'
3
+ require 'ostruct'
4
+ require 'erb'
5
+ require 'multi_json'
6
+ require 'elastics/logger'
7
+ require 'elastics/errors'
8
+ require 'elastics/utils'
9
+
10
+ require 'elastics/struct/prunable'
11
+ require 'elastics/struct/symbolize'
12
+ require 'elastics/struct/hash'
13
+ require 'elastics/struct/array'
14
+
15
+ require 'elastics/variables'
16
+
17
+ require 'elastics/result'
18
+ require 'elastics/struct/paginable'
19
+ require 'elastics/result/document'
20
+ require 'elastics/result/search'
21
+ require 'elastics/result/multi_get'
22
+ require 'elastics/result/bulk'
23
+
24
+ require 'elastics/template/common'
25
+ require 'elastics/template/partial'
26
+ require 'elastics/template/logger'
27
+ require 'elastics/template'
28
+ require 'elastics/template/search'
29
+ require 'elastics/template/slim_search'
30
+ require 'elastics/template/tags'
31
+
32
+ require 'elastics/class_proxy/base'
33
+ require 'elastics/class_proxy/templates/search'
34
+ require 'elastics/class_proxy/templates/doc'
35
+
36
+ require 'elastics/class_proxy/templates'
37
+
38
+ require 'elastics/templates'
39
+
40
+ require 'elastics/http_clients/base'
41
+ require 'elastics/http_clients/loader'
42
+ require 'elastics/configuration'
43
+ require 'elastics/utility_methods'
44
+
45
+ require 'progressbar'
46
+ require 'elastics/prog_bar'
47
+ require 'elastics/deprecation'
48
+
49
+ require 'elastics/api_stubs'
50
+ require 'elastics/tasks'
51
+
52
+ module Elastics
53
+
54
+ VERSION = File.read(File.expand_path('../../VERSION', __FILE__)).strip
55
+ LIB_PATHS = [ File.dirname(__FILE__) ]
56
+
57
+
58
+ include ApiStubs
59
+
60
+ include Templates
61
+ elastics.load_source File.expand_path('../elastics/api_templates/core_api.yml' , __FILE__)
62
+ elastics.load_source File.expand_path('../elastics/api_templates/indices_api.yml', __FILE__)
63
+ elastics.load_source File.expand_path('../elastics/api_templates/cluster_api.yml', __FILE__)
64
+
65
+ extend self
66
+ extend UtilityMethods
67
+
68
+ elastics.wrap :post_bulk_string, :bulk do |*vars|
69
+ vars = Vars.new(*vars)
70
+ return if vars[:bulk_string].nil? || vars[:bulk_string].empty?
71
+ super vars
72
+ end
73
+
74
+ # get a document without using the get API (which doesn't support fields '*')
75
+ elastics.wrap :search_by_id do |*vars|
76
+ vars = Vars.new(*vars)
77
+ result = super(vars)
78
+ doc = result['hits']['hits'].first
79
+ class << doc; self end.class_eval do
80
+ define_method(:raw_result){ result }
81
+ end
82
+ doc
83
+ end
84
+
85
+ # support for live-reindex
86
+ elastics.wrap :store, :put_store, :post_store do |*vars|
87
+ vars = Vars.new(*vars)
88
+ vars[:index] = LiveReindex.prefix_index(vars[:index]) if LiveReindex.should_prefix_index?
89
+ result = super(vars)
90
+ if LiveReindex.should_track_change?
91
+ vars.delete(:data)
92
+ LiveReindex.track_change(:index, dump_one(vars))
93
+ end
94
+ result
95
+ end
96
+
97
+ # support for live-reindex
98
+ elastics.wrap :delete, :remove do |*vars|
99
+ vars = Vars.new(*vars)
100
+ vars[:index] = LiveReindex.prefix_index(vars[:index]) if LiveReindex.should_prefix_index?
101
+ if LiveReindex.should_track_change?
102
+ vars.delete(:data)
103
+ LiveReindex.track_change(:delete, dump_one(vars))
104
+ end
105
+ super(vars)
106
+ end
107
+
108
+ end
@@ -0,0 +1,1268 @@
1
+ module Elastics
2
+ module ApiStubs
3
+
4
+ # The following lines are autogenerated by Elastics.doc
5
+
6
+ ######################## Core API ########################
7
+
8
+ # ########## Elastics.store ##########
9
+ # --------------
10
+ # Elastics::Template
11
+ # ---
12
+ # store:
13
+ # - PUT
14
+ # - /<<index>>/<<type>>/<<id>>
15
+ #
16
+ #
17
+ # Usage:
18
+ # Elastics.store :id => id, # required
19
+ # :type => nil,
20
+ # :index => "elastics_test_index"
21
+ #
22
+ def Elastics.store(*vars)
23
+ ## this is a stub, used for reference
24
+ super
25
+ end
26
+
27
+ # ########## Elastics.put_store ##########
28
+ # --------------
29
+ # Elastics::Template
30
+ # ---
31
+ # put_store:
32
+ # - PUT
33
+ # - /<<index>>/<<type>>/<<id>>
34
+ #
35
+ #
36
+ # Usage:
37
+ # Elastics.put_store :id => id, # required
38
+ # :type => nil,
39
+ # :index => "elastics_test_index"
40
+ #
41
+ def Elastics.put_store(*vars)
42
+ ## this is a stub, used for reference
43
+ super
44
+ end
45
+
46
+ # ########## Elastics.post_store ##########
47
+ # --------------
48
+ # Elastics::Template
49
+ # ---
50
+ # post_store:
51
+ # - POST
52
+ # - /<<index>>/<<type>>
53
+ #
54
+ #
55
+ # Usage:
56
+ # Elastics.post_store :index => "elastics_test_index",
57
+ # :type => nil
58
+ #
59
+ def Elastics.post_store(*vars)
60
+ ## this is a stub, used for reference
61
+ super
62
+ end
63
+
64
+ # ########## Elastics.delete ##########
65
+ # --------------
66
+ # Elastics::Template
67
+ # ---
68
+ # delete:
69
+ # - DELETE
70
+ # - /<<index>>/<<type>>/<<id>>
71
+ #
72
+ #
73
+ # Usage:
74
+ # Elastics.delete :id => id, # required
75
+ # :type => nil,
76
+ # :index => "elastics_test_index"
77
+ #
78
+ def Elastics.delete(*vars)
79
+ ## this is a stub, used for reference
80
+ super
81
+ end
82
+
83
+ # ########## Elastics.remove ##########
84
+ # --------------
85
+ # Elastics::Template
86
+ # ---
87
+ # remove:
88
+ # - DELETE
89
+ # - /<<index>>/<<type>>/<<id>>
90
+ #
91
+ #
92
+ # Usage:
93
+ # Elastics.remove :id => id, # required
94
+ # :type => nil,
95
+ # :index => "elastics_test_index"
96
+ #
97
+ def Elastics.remove(*vars)
98
+ ## this is a stub, used for reference
99
+ super
100
+ end
101
+
102
+ # ########## Elastics.get ##########
103
+ # --------------
104
+ # Elastics::Template
105
+ # ---
106
+ # get:
107
+ # - GET
108
+ # - /<<index>>/<<type>>/<<id>>
109
+ #
110
+ #
111
+ # Usage:
112
+ # Elastics.get :id => id, # required
113
+ # :type => nil,
114
+ # :index => "elastics_test_index"
115
+ #
116
+ def Elastics.get(*vars)
117
+ ## this is a stub, used for reference
118
+ super
119
+ end
120
+
121
+ # ########## Elastics.get_source ##########
122
+ # --------------
123
+ # Elastics::Template
124
+ # ---
125
+ # get_source:
126
+ # - GET
127
+ # - /<<index>>/<<type>>/<<id>>/_source
128
+ #
129
+ #
130
+ # Usage:
131
+ # Elastics.get_source :id => id, # required
132
+ # :type => nil,
133
+ # :index => "elastics_test_index"
134
+ #
135
+ def Elastics.get_source(*vars)
136
+ ## this is a stub, used for reference
137
+ super
138
+ end
139
+
140
+ # ########## Elastics.multi_get ##########
141
+ # --------------
142
+ # Elastics::Template
143
+ # ---
144
+ # multi_get:
145
+ # - GET
146
+ # - /<<index>>/<<type>>/_mget
147
+ # - ids: << ids >>
148
+ #
149
+ #
150
+ # Usage:
151
+ # Elastics.multi_get :ids => ids, # required
152
+ # :type => nil,
153
+ # :index => "elastics_test_index"
154
+ #
155
+ def Elastics.multi_get(*vars)
156
+ ## this is a stub, used for reference
157
+ super
158
+ end
159
+
160
+ # ########## Elastics.update ##########
161
+ # --------------
162
+ # Elastics::Template
163
+ # ---
164
+ # update:
165
+ # - POST
166
+ # - /<<index>>/<<type>>/<<id>>/_update
167
+ #
168
+ #
169
+ # Usage:
170
+ # Elastics.update :id => id, # required
171
+ # :type => nil,
172
+ # :index => "elastics_test_index"
173
+ #
174
+ def Elastics.update(*vars)
175
+ ## this is a stub, used for reference
176
+ super
177
+ end
178
+
179
+ # ########## Elastics.percolate ##########
180
+ # --------------
181
+ # Elastics::Template
182
+ # ---
183
+ # percolate:
184
+ # - GET
185
+ # - /<<index>>/<<type>>/_percolate
186
+ #
187
+ #
188
+ # Usage:
189
+ # Elastics.percolate :index => "elastics_test_index",
190
+ # :type => nil
191
+ #
192
+ def Elastics.percolate(*vars)
193
+ ## this is a stub, used for reference
194
+ super
195
+ end
196
+
197
+ # ########## Elastics.put_percolator ##########
198
+ # --------------
199
+ # Elastics::Template
200
+ # ---
201
+ # put_percolator:
202
+ # - PUT
203
+ # - /_percolator/<<index>>/<<percolator>>
204
+ #
205
+ #
206
+ # Usage:
207
+ # Elastics.put_percolator :percolator => percolator, # required
208
+ # :index => "elastics_test_index"
209
+ #
210
+ def Elastics.put_percolator(*vars)
211
+ ## this is a stub, used for reference
212
+ super
213
+ end
214
+
215
+ # ########## Elastics.delete_percolator ##########
216
+ # --------------
217
+ # Elastics::Template
218
+ # ---
219
+ # delete_percolator:
220
+ # - DELETE
221
+ # - /_percolator/<<index>>/<<percolator>>
222
+ #
223
+ #
224
+ # Usage:
225
+ # Elastics.delete_percolator :percolator => percolator, # required
226
+ # :index => "elastics_test_index"
227
+ #
228
+ def Elastics.delete_percolator(*vars)
229
+ ## this is a stub, used for reference
230
+ super
231
+ end
232
+
233
+ # ########## Elastics.post_bulk_string ##########
234
+ # --------------
235
+ # Elastics::Template
236
+ # ---
237
+ # post_bulk_string:
238
+ # - POST
239
+ # - /_bulk
240
+ # - << bulk_string >>
241
+ #
242
+ #
243
+ # Usage:
244
+ # Elastics.bulk :bulk_string => bulk_string # required
245
+ #
246
+ def Elastics.post_bulk_string(*vars)
247
+ ## this is a stub, used for reference
248
+ super
249
+ end
250
+
251
+ # ########## Elastics.count ##########
252
+ # --------------
253
+ # Elastics::Template
254
+ # ---
255
+ # count:
256
+ # - GET
257
+ # - /<<index>>/<<type>>/_count
258
+ #
259
+ #
260
+ # Usage:
261
+ # Elastics.count :index => "elastics_test_index",
262
+ # :type => nil
263
+ #
264
+ def Elastics.count(*vars)
265
+ ## this is a stub, used for reference
266
+ super
267
+ end
268
+
269
+ # ########## Elastics.delete_by_query ##########
270
+ # --------------
271
+ # Elastics::Template
272
+ # ---
273
+ # delete_by_query:
274
+ # - DELETE
275
+ # - /<<index>>/<<type>>/_query
276
+ #
277
+ #
278
+ # Usage:
279
+ # Elastics.delete_by_query :index => "elastics_test_index",
280
+ # :type => nil
281
+ #
282
+ def Elastics.delete_by_query(*vars)
283
+ ## this is a stub, used for reference
284
+ super
285
+ end
286
+
287
+ # ########## Elastics.more_like_this ##########
288
+ # --------------
289
+ # Elastics::Template
290
+ # ---
291
+ # more_like_this:
292
+ # - GET
293
+ # - /<<index>>/<<type>>/<<id>>/_mlt
294
+ #
295
+ #
296
+ # Usage:
297
+ # Elastics.more_like_this :id => id, # required
298
+ # :type => nil,
299
+ # :index => "elastics_test_index"
300
+ #
301
+ def Elastics.more_like_this(*vars)
302
+ ## this is a stub, used for reference
303
+ super
304
+ end
305
+
306
+ # ########## Elastics.mlt ##########
307
+ # --------------
308
+ # Elastics::Template
309
+ # ---
310
+ # mlt:
311
+ # - GET
312
+ # - /<<index>>/<<type>>/<<id>>/_mlt
313
+ #
314
+ #
315
+ # Usage:
316
+ # Elastics.mlt :id => id, # required
317
+ # :type => nil,
318
+ # :index => "elastics_test_index"
319
+ #
320
+ def Elastics.mlt(*vars)
321
+ ## this is a stub, used for reference
322
+ super
323
+ end
324
+
325
+ # ########## Elastics.validate ##########
326
+ # --------------
327
+ # Elastics::Template
328
+ # ---
329
+ # validate:
330
+ # - GET
331
+ # - /<<index>>/<<type>>/_validate/query
332
+ #
333
+ #
334
+ # Usage:
335
+ # Elastics.validate :index => "elastics_test_index",
336
+ # :type => nil
337
+ #
338
+ def Elastics.validate(*vars)
339
+ ## this is a stub, used for reference
340
+ super
341
+ end
342
+
343
+ # ########## Elastics.explain ##########
344
+ # --------------
345
+ # Elastics::Template
346
+ # ---
347
+ # explain:
348
+ # - GET
349
+ # - /<<index>>/<<type>>/<<id>>/_explain
350
+ #
351
+ #
352
+ # Usage:
353
+ # Elastics.explain :id => id, # required
354
+ # :type => nil,
355
+ # :index => "elastics_test_index"
356
+ #
357
+ def Elastics.explain(*vars)
358
+ ## this is a stub, used for reference
359
+ super
360
+ end
361
+
362
+ # ########## Elastics.match_all ##########
363
+ # --------------
364
+ # Elastics::Template
365
+ # ---
366
+ # match_all:
367
+ # - GET
368
+ # - /<<index>>/<<type>>/_search
369
+ # - query:
370
+ # match_all: {}
371
+ #
372
+ #
373
+ # Usage:
374
+ # Elastics.match_all :index => "elastics_test_index",
375
+ # :type => nil
376
+ #
377
+ def Elastics.match_all(*vars)
378
+ ## this is a stub, used for reference
379
+ super
380
+ end
381
+
382
+ # ########## Elastics.search_by_id ##########
383
+ # --------------
384
+ # Elastics::Template
385
+ # ---
386
+ # search_by_id:
387
+ # - GET
388
+ # - /<<index>>/<<type>>/_search
389
+ # - query:
390
+ # term:
391
+ # _id: <<id>>
392
+ #
393
+ #
394
+ # Usage:
395
+ # Elastics.search_by_id :id => id, # required
396
+ # :type => nil,
397
+ # :index => "elastics_test_index",
398
+ #
399
+ def Elastics.search_by_id(*vars)
400
+ ## this is a stub, used for reference
401
+ super
402
+ end
403
+
404
+ ######################## Indices API ########################
405
+
406
+ # ########## Elastics.post_index_aliases ##########
407
+ # --------------
408
+ # Elastics::Template
409
+ # ---
410
+ # post_index_aliases:
411
+ # - POST
412
+ # - /_aliases
413
+ #
414
+ #
415
+ # Usage:
416
+ # Elastics.post_index_aliases
417
+ #
418
+ def Elastics.post_index_aliases(*vars)
419
+ ## this is a stub, used for reference
420
+ super
421
+ end
422
+
423
+ # ########## Elastics.get_index_aliases ##########
424
+ # --------------
425
+ # Elastics::Template
426
+ # ---
427
+ # get_index_aliases:
428
+ # - GET
429
+ # - /<<index>>/_aliases
430
+ #
431
+ #
432
+ # Usage:
433
+ # Elastics.get_index_aliases :index => "elastics_test_index"
434
+ #
435
+ def Elastics.get_index_aliases(*vars)
436
+ ## this is a stub, used for reference
437
+ super
438
+ end
439
+
440
+ # ########## Elastics.add_index_alias ##########
441
+ # --------------
442
+ # Elastics::Template
443
+ # ---
444
+ # add_index_alias:
445
+ # - PUT
446
+ # - /<<index>>/_alias/<<alias>>
447
+ #
448
+ #
449
+ # Usage:
450
+ # Elastics.add_index_alias :alias => alias, # required
451
+ # :index => "elastics_test_index"
452
+ #
453
+ def Elastics.add_index_alias(*vars)
454
+ ## this is a stub, used for reference
455
+ super
456
+ end
457
+
458
+ # ########## Elastics.delete_index_alias ##########
459
+ # --------------
460
+ # Elastics::Template
461
+ # ---
462
+ # delete_index_alias:
463
+ # - DELETE
464
+ # - /<<index>>/_alias/<<alias>>
465
+ #
466
+ #
467
+ # Usage:
468
+ # Elastics.delete_index_alias :alias => alias, # required
469
+ # :index => "elastics_test_index"
470
+ #
471
+ def Elastics.delete_index_alias(*vars)
472
+ ## this is a stub, used for reference
473
+ super
474
+ end
475
+
476
+ # ########## Elastics.get_index_alias ##########
477
+ # --------------
478
+ # Elastics::Template
479
+ # ---
480
+ # get_index_alias:
481
+ # - GET
482
+ # - /<<index>>/_alias/<<alias= '*' >>
483
+ #
484
+ #
485
+ # Usage:
486
+ # Elastics.get_index_alias :index => "elastics_test_index",
487
+ # :alias => "*"
488
+ #
489
+ def Elastics.get_index_alias(*vars)
490
+ ## this is a stub, used for reference
491
+ super
492
+ end
493
+
494
+ # ########## Elastics.analyze_index ##########
495
+ # --------------
496
+ # Elastics::Template
497
+ # ---
498
+ # analyze_index:
499
+ # - GET
500
+ # - /<<index>>/_analyze
501
+ #
502
+ #
503
+ # Usage:
504
+ # Elastics.analyze_index :index => "elastics_test_index"
505
+ #
506
+ def Elastics.analyze_index(*vars)
507
+ ## this is a stub, used for reference
508
+ super
509
+ end
510
+
511
+ # ########## Elastics.put_index ##########
512
+ # --------------
513
+ # Elastics::Template
514
+ # ---
515
+ # put_index:
516
+ # - PUT
517
+ # - /<<index>>
518
+ # - settings:
519
+ # number_of_shards: <<number_of_shards= 5 >>
520
+ # number_of_replicas: <<number_of_replicas= 1 >>
521
+ #
522
+ #
523
+ # Usage:
524
+ # Elastics.put_index :index => "elastics_test_index",
525
+ # :number_of_shards => 5,
526
+ # :number_of_replicas => 1
527
+ #
528
+ def Elastics.put_index(*vars)
529
+ ## this is a stub, used for reference
530
+ super
531
+ end
532
+
533
+ # ########## Elastics.create_index ##########
534
+ # --------------
535
+ # Elastics::Template
536
+ # ---
537
+ # create_index:
538
+ # - PUT
539
+ # - /<<index>>
540
+ # - settings:
541
+ # number_of_shards: <<number_of_shards= 5 >>
542
+ # number_of_replicas: <<number_of_replicas= 1 >>
543
+ #
544
+ #
545
+ # Usage:
546
+ # Elastics.create_index :index => "elastics_test_index",
547
+ # :number_of_shards => 5,
548
+ # :number_of_replicas => 1
549
+ #
550
+ def Elastics.create_index(*vars)
551
+ ## this is a stub, used for reference
552
+ super
553
+ end
554
+
555
+ # ########## Elastics.post_index ##########
556
+ # --------------
557
+ # Elastics::Template
558
+ # ---
559
+ # post_index:
560
+ # - POST
561
+ # - /<<index>>
562
+ # - settings:
563
+ # number_of_shards: <<number_of_shards= 5 >>
564
+ # number_of_replicas: <<number_of_replicas= 1 >>
565
+ #
566
+ #
567
+ # Usage:
568
+ # Elastics.post_index :index => "elastics_test_index",
569
+ # :number_of_shards => 5,
570
+ # :number_of_replicas => 1
571
+ #
572
+ def Elastics.post_index(*vars)
573
+ ## this is a stub, used for reference
574
+ super
575
+ end
576
+
577
+ # ########## Elastics.delete_index ##########
578
+ # --------------
579
+ # Elastics::Template
580
+ # ---
581
+ # delete_index:
582
+ # - DELETE
583
+ # - /<<index>>
584
+ #
585
+ #
586
+ # Usage:
587
+ # Elastics.delete_index :index => "elastics_test_index"
588
+ #
589
+ def Elastics.delete_index(*vars)
590
+ ## this is a stub, used for reference
591
+ super
592
+ end
593
+
594
+ # ########## Elastics.close_index ##########
595
+ # --------------
596
+ # Elastics::Template
597
+ # ---
598
+ # close_index:
599
+ # - POST
600
+ # - /<<index>>/_close
601
+ #
602
+ #
603
+ # Usage:
604
+ # Elastics.close_index :index => "elastics_test_index"
605
+ #
606
+ def Elastics.close_index(*vars)
607
+ ## this is a stub, used for reference
608
+ super
609
+ end
610
+
611
+ # ########## Elastics.open_index ##########
612
+ # --------------
613
+ # Elastics::Template
614
+ # ---
615
+ # open_index:
616
+ # - POST
617
+ # - /<<index>>/_close
618
+ #
619
+ #
620
+ # Usage:
621
+ # Elastics.open_index :index => "elastics_test_index"
622
+ #
623
+ def Elastics.open_index(*vars)
624
+ ## this is a stub, used for reference
625
+ super
626
+ end
627
+
628
+ # ########## Elastics.get_index_settings ##########
629
+ # --------------
630
+ # Elastics::Template
631
+ # ---
632
+ # get_index_settings:
633
+ # - GET
634
+ # - /<<index>>/_settings
635
+ #
636
+ #
637
+ # Usage:
638
+ # Elastics.get_index_settings :index => "elastics_test_index"
639
+ #
640
+ def Elastics.get_index_settings(*vars)
641
+ ## this is a stub, used for reference
642
+ super
643
+ end
644
+
645
+ # ########## Elastics.get_settings ##########
646
+ # --------------
647
+ # Elastics::Template
648
+ # ---
649
+ # get_settings:
650
+ # - GET
651
+ # - /<<index>>/_settings
652
+ #
653
+ #
654
+ # Usage:
655
+ # Elastics.get_settings :index => "elastics_test_index"
656
+ #
657
+ def Elastics.get_settings(*vars)
658
+ ## this is a stub, used for reference
659
+ super
660
+ end
661
+
662
+ # ########## Elastics.get_index_mapping ##########
663
+ # --------------
664
+ # Elastics::Template
665
+ # ---
666
+ # get_index_mapping:
667
+ # - GET
668
+ # - /<<index>>/<<type>>/_mapping
669
+ #
670
+ #
671
+ # Usage:
672
+ # Elastics.get_index_mapping :index => "elastics_test_index",
673
+ # :type => nil
674
+ #
675
+ def Elastics.get_index_mapping(*vars)
676
+ ## this is a stub, used for reference
677
+ super
678
+ end
679
+
680
+ # ########## Elastics.get_mapping ##########
681
+ # --------------
682
+ # Elastics::Template
683
+ # ---
684
+ # get_mapping:
685
+ # - GET
686
+ # - /<<index>>/<<type>>/_mapping
687
+ #
688
+ #
689
+ # Usage:
690
+ # Elastics.get_mapping :index => "elastics_test_index",
691
+ # :type => nil
692
+ #
693
+ def Elastics.get_mapping(*vars)
694
+ ## this is a stub, used for reference
695
+ super
696
+ end
697
+
698
+ # ########## Elastics.put_index_mapping ##########
699
+ # --------------
700
+ # Elastics::Template
701
+ # ---
702
+ # put_index_mapping:
703
+ # - PUT
704
+ # - /<<index>>/<<type>>/_mapping
705
+ # - <<type>>:
706
+ # properties: <<properties>>
707
+ #
708
+ #
709
+ # Usage:
710
+ # Elastics.put_index_mapping :properties => properties, # required
711
+ # :type => nil,
712
+ # :index => "elastics_test_index"
713
+ #
714
+ def Elastics.put_index_mapping(*vars)
715
+ ## this is a stub, used for reference
716
+ super
717
+ end
718
+
719
+ # ########## Elastics.put_mapping ##########
720
+ # --------------
721
+ # Elastics::Template
722
+ # ---
723
+ # put_mapping:
724
+ # - PUT
725
+ # - /<<index>>/<<type>>/_mapping
726
+ # - <<type>>:
727
+ # properties: <<properties>>
728
+ #
729
+ #
730
+ # Usage:
731
+ # Elastics.put_mapping :properties => properties, # required
732
+ # :type => nil,
733
+ # :index => "elastics_test_index"
734
+ #
735
+ def Elastics.put_mapping(*vars)
736
+ ## this is a stub, used for reference
737
+ super
738
+ end
739
+
740
+ # ########## Elastics.delete_index_mapping ##########
741
+ # --------------
742
+ # Elastics::Template
743
+ # ---
744
+ # delete_index_mapping:
745
+ # - DELETE
746
+ # - /<<index>>/<<type>>
747
+ #
748
+ #
749
+ # Usage:
750
+ # Elastics.delete_index_mapping :index => "elastics_test_index",
751
+ # :type => nil
752
+ #
753
+ def Elastics.delete_index_mapping(*vars)
754
+ ## this is a stub, used for reference
755
+ super
756
+ end
757
+
758
+ # ########## Elastics.delete_mapping ##########
759
+ # --------------
760
+ # Elastics::Template
761
+ # ---
762
+ # delete_mapping:
763
+ # - DELETE
764
+ # - /<<index>>/<<type>>
765
+ #
766
+ #
767
+ # Usage:
768
+ # Elastics.delete_mapping :index => "elastics_test_index",
769
+ # :type => nil
770
+ #
771
+ def Elastics.delete_mapping(*vars)
772
+ ## this is a stub, used for reference
773
+ super
774
+ end
775
+
776
+ # ########## Elastics.refresh_index ##########
777
+ # --------------
778
+ # Elastics::Template
779
+ # ---
780
+ # refresh_index:
781
+ # - POST
782
+ # - /<<index>>/_refresh
783
+ #
784
+ #
785
+ # Usage:
786
+ # Elastics.refresh_index :index => "elastics_test_index"
787
+ #
788
+ def Elastics.refresh_index(*vars)
789
+ ## this is a stub, used for reference
790
+ super
791
+ end
792
+
793
+ # ########## Elastics.optimize_index ##########
794
+ # --------------
795
+ # Elastics::Template
796
+ # ---
797
+ # optimize_index:
798
+ # - POST
799
+ # - /<<index>>/_optimize
800
+ #
801
+ #
802
+ # Usage:
803
+ # Elastics.optimize_index :index => "elastics_test_index"
804
+ #
805
+ def Elastics.optimize_index(*vars)
806
+ ## this is a stub, used for reference
807
+ super
808
+ end
809
+
810
+ # ########## Elastics.flush_index ##########
811
+ # --------------
812
+ # Elastics::Template
813
+ # ---
814
+ # flush_index:
815
+ # - POST
816
+ # - /<<index>>/_flush
817
+ #
818
+ #
819
+ # Usage:
820
+ # Elastics.flush_index :index => "elastics_test_index"
821
+ #
822
+ def Elastics.flush_index(*vars)
823
+ ## this is a stub, used for reference
824
+ super
825
+ end
826
+
827
+ # ########## Elastics.gateway_snapshot ##########
828
+ # --------------
829
+ # Elastics::Template
830
+ # ---
831
+ # gateway_snapshot:
832
+ # - POST
833
+ # - /<<index>>/_gateway/snapshot
834
+ #
835
+ #
836
+ # Usage:
837
+ # Elastics.gateway_snapshot :index => "elastics_test_index"
838
+ #
839
+ def Elastics.gateway_snapshot(*vars)
840
+ ## this is a stub, used for reference
841
+ super
842
+ end
843
+
844
+ # ########## Elastics.update_index_settings ##########
845
+ # --------------
846
+ # Elastics::Template
847
+ # ---
848
+ # update_index_settings:
849
+ # - PUT
850
+ # - /<<index>>/_settings
851
+ #
852
+ #
853
+ # Usage:
854
+ # Elastics.update_index_settings :index => "elastics_test_index"
855
+ #
856
+ def Elastics.update_index_settings(*vars)
857
+ ## this is a stub, used for reference
858
+ super
859
+ end
860
+
861
+ # ########## Elastics.put_index_template ##########
862
+ # --------------
863
+ # Elastics::Template
864
+ # ---
865
+ # put_index_template:
866
+ # - PUT
867
+ # - /_template/<<template>>
868
+ #
869
+ #
870
+ # Usage:
871
+ # Elastics.put_index_template :template => template # required
872
+ #
873
+ def Elastics.put_index_template(*vars)
874
+ ## this is a stub, used for reference
875
+ super
876
+ end
877
+
878
+ # ########## Elastics.delete_index_template ##########
879
+ # --------------
880
+ # Elastics::Template
881
+ # ---
882
+ # delete_index_template:
883
+ # - DELETE
884
+ # - /_template/<<template>>
885
+ #
886
+ #
887
+ # Usage:
888
+ # Elastics.delete_index_template :template => template # required
889
+ #
890
+ def Elastics.delete_index_template(*vars)
891
+ ## this is a stub, used for reference
892
+ super
893
+ end
894
+
895
+ # ########## Elastics.get_index_template ##########
896
+ # --------------
897
+ # Elastics::Template
898
+ # ---
899
+ # get_index_template:
900
+ # - GET
901
+ # - /_template/<<template>>
902
+ #
903
+ #
904
+ # Usage:
905
+ # Elastics.get_index_template :template => template # required
906
+ #
907
+ def Elastics.get_index_template(*vars)
908
+ ## this is a stub, used for reference
909
+ super
910
+ end
911
+
912
+ # ########## Elastics.put_index_warmer ##########
913
+ # --------------
914
+ # Elastics::Template
915
+ # ---
916
+ # put_index_warmer:
917
+ # - PUT
918
+ # - /<<index>>/<<type>>/_warmer/<<warmer>>
919
+ #
920
+ #
921
+ # Usage:
922
+ # Elastics.put_index_warmer :warmer => warmer, # required
923
+ # :type => nil,
924
+ # :index => "elastics_test_index"
925
+ #
926
+ def Elastics.put_index_warmer(*vars)
927
+ ## this is a stub, used for reference
928
+ super
929
+ end
930
+
931
+ # ########## Elastics.delete_index_warmer ##########
932
+ # --------------
933
+ # Elastics::Template
934
+ # ---
935
+ # delete_index_warmer:
936
+ # - DELETE
937
+ # - /<<index>>/_warmer/<<warmer= ~ >>
938
+ #
939
+ #
940
+ # Usage:
941
+ # Elastics.delete_index_warmer :index => "elastics_test_index",
942
+ # :warmer => nil
943
+ #
944
+ def Elastics.delete_index_warmer(*vars)
945
+ ## this is a stub, used for reference
946
+ super
947
+ end
948
+
949
+ # ########## Elastics.get_index_warmer ##########
950
+ # --------------
951
+ # Elastics::Template
952
+ # ---
953
+ # get_index_warmer:
954
+ # - GET
955
+ # - /<<index>>/_warmer/<<warmer= ~ >>
956
+ #
957
+ #
958
+ # Usage:
959
+ # Elastics.get_index_warmer :index => "elastics_test_index",
960
+ # :warmer => nil
961
+ #
962
+ def Elastics.get_index_warmer(*vars)
963
+ ## this is a stub, used for reference
964
+ super
965
+ end
966
+
967
+ # ########## Elastics.index_stats ##########
968
+ # --------------
969
+ # Elastics::Template
970
+ # ---
971
+ # index_stats:
972
+ # - GET
973
+ # - /<<index>>/_stats/<<endpoint= ~ >>/<<names= ~ >>
974
+ #
975
+ #
976
+ # Usage:
977
+ # Elastics.index_stats :index => "elastics_test_index",
978
+ # :endpoint => nil,
979
+ # :names => nil
980
+ #
981
+ def Elastics.index_stats(*vars)
982
+ ## this is a stub, used for reference
983
+ super
984
+ end
985
+
986
+ # ########## Elastics.stats ##########
987
+ # --------------
988
+ # Elastics::Template
989
+ # ---
990
+ # stats:
991
+ # - GET
992
+ # - /<<index>>/_stats/<<endpoint= ~ >>/<<names= ~ >>
993
+ #
994
+ #
995
+ # Usage:
996
+ # Elastics.stats :index => "elastics_test_index",
997
+ # :endpoint => nil,
998
+ # :names => nil
999
+ #
1000
+ def Elastics.stats(*vars)
1001
+ ## this is a stub, used for reference
1002
+ super
1003
+ end
1004
+
1005
+ # ########## Elastics.index_status ##########
1006
+ # --------------
1007
+ # Elastics::Template
1008
+ # ---
1009
+ # index_status:
1010
+ # - GET
1011
+ # - /<<index>>/_status
1012
+ #
1013
+ #
1014
+ # Usage:
1015
+ # Elastics.index_status :index => "elastics_test_index"
1016
+ #
1017
+ def Elastics.index_status(*vars)
1018
+ ## this is a stub, used for reference
1019
+ super
1020
+ end
1021
+
1022
+ # ########## Elastics.index_segments ##########
1023
+ # --------------
1024
+ # Elastics::Template
1025
+ # ---
1026
+ # index_segments:
1027
+ # - GET
1028
+ # - /<<index>>/_segments
1029
+ #
1030
+ #
1031
+ # Usage:
1032
+ # Elastics.index_segments :index => "elastics_test_index"
1033
+ #
1034
+ def Elastics.index_segments(*vars)
1035
+ ## this is a stub, used for reference
1036
+ super
1037
+ end
1038
+
1039
+ # ########## Elastics.index_clearcache ##########
1040
+ # --------------
1041
+ # Elastics::Template
1042
+ # ---
1043
+ # index_clearcache:
1044
+ # - POST
1045
+ # - /<<index>>/_cache/clear
1046
+ #
1047
+ #
1048
+ # Usage:
1049
+ # Elastics.index_clearcache :index => "elastics_test_index"
1050
+ #
1051
+ def Elastics.index_clearcache(*vars)
1052
+ ## this is a stub, used for reference
1053
+ super
1054
+ end
1055
+
1056
+ # ########## Elastics.indices_exists ##########
1057
+ # --------------
1058
+ # Elastics::Template
1059
+ # ---
1060
+ # indices_exists:
1061
+ # - HEAD
1062
+ # - /<<index>>
1063
+ #
1064
+ #
1065
+ # Usage:
1066
+ # Elastics.indices_exists :index => "elastics_test_index"
1067
+ #
1068
+ def Elastics.indices_exists(*vars)
1069
+ ## this is a stub, used for reference
1070
+ super
1071
+ end
1072
+
1073
+ # ########## Elastics.exist? ##########
1074
+ # --------------
1075
+ # Elastics::Template
1076
+ # ---
1077
+ # exist?:
1078
+ # - HEAD
1079
+ # - /<<index>>
1080
+ #
1081
+ #
1082
+ # Usage:
1083
+ # Elastics.exist? :index => "elastics_test_index"
1084
+ #
1085
+ def Elastics.exist?(*vars)
1086
+ ## this is a stub, used for reference
1087
+ super
1088
+ end
1089
+
1090
+ # ########## Elastics.types_exists ##########
1091
+ # --------------
1092
+ # Elastics::Template
1093
+ # ---
1094
+ # types_exists:
1095
+ # - HEAD
1096
+ # - /<<index>>/<<type>>
1097
+ #
1098
+ #
1099
+ # Usage:
1100
+ # Elastics.types_exists :index => "elastics_test_index",
1101
+ # :type => nil
1102
+ #
1103
+ def Elastics.types_exists(*vars)
1104
+ ## this is a stub, used for reference
1105
+ super
1106
+ end
1107
+
1108
+
1109
+ ######################## Cluster API ########################
1110
+
1111
+ # ########## Elastics.cluster_health ##########
1112
+ # --------------
1113
+ # Elastics::Template
1114
+ # ---
1115
+ # cluster_health:
1116
+ # - GET
1117
+ # - /_cluster/health/<<index>>
1118
+ #
1119
+ #
1120
+ # Usage:
1121
+ # Elastics.cluster_health :index => "elastics_test_index"
1122
+ #
1123
+ def Elastics.cluster_health(*vars)
1124
+ ## this is a stub, used for reference
1125
+ super
1126
+ end
1127
+
1128
+ # ########## Elastics.cluster_state ##########
1129
+ # --------------
1130
+ # Elastics::Template
1131
+ # ---
1132
+ # cluster_state:
1133
+ # - GET
1134
+ # - /_cluster/state
1135
+ #
1136
+ #
1137
+ # Usage:
1138
+ # Elastics.cluster_state
1139
+ #
1140
+ def Elastics.cluster_state(*vars)
1141
+ ## this is a stub, used for reference
1142
+ super
1143
+ end
1144
+
1145
+ # ########## Elastics.put_cluster_settings ##########
1146
+ # --------------
1147
+ # Elastics::Template
1148
+ # ---
1149
+ # put_cluster_settings:
1150
+ # - PUT
1151
+ # - /_cluster/settings
1152
+ #
1153
+ #
1154
+ # Usage:
1155
+ # Elastics.put_cluster_settings
1156
+ #
1157
+ def Elastics.put_cluster_settings(*vars)
1158
+ ## this is a stub, used for reference
1159
+ super
1160
+ end
1161
+
1162
+ # ########## Elastics.get_cluster_settings ##########
1163
+ # --------------
1164
+ # Elastics::Template
1165
+ # ---
1166
+ # get_cluster_settings:
1167
+ # - GET
1168
+ # - /_cluster/settings
1169
+ #
1170
+ #
1171
+ # Usage:
1172
+ # Elastics.get_cluster_settings
1173
+ #
1174
+ def Elastics.get_cluster_settings(*vars)
1175
+ ## this is a stub, used for reference
1176
+ super
1177
+ end
1178
+
1179
+ # ########## Elastics.cluster_nodes_info ##########
1180
+ # --------------
1181
+ # Elastics::Template
1182
+ # ---
1183
+ # cluster_nodes_info:
1184
+ # - GET
1185
+ # - /_nodes/<<nodes= ~ >>/<<endpoint= ~ >>
1186
+ #
1187
+ #
1188
+ # Usage:
1189
+ # Elastics.cluster_nodes_info :nodes => nil,
1190
+ # :endpoint => nil
1191
+ #
1192
+ def Elastics.cluster_nodes_info(*vars)
1193
+ ## this is a stub, used for reference
1194
+ super
1195
+ end
1196
+
1197
+ # ########## Elastics.cluster_nodes_stats ##########
1198
+ # --------------
1199
+ # Elastics::Template
1200
+ # ---
1201
+ # cluster_nodes_stats:
1202
+ # - GET
1203
+ # - /_nodes/<<nodes= ~ >>/stats/<<endpoint= ~ >>
1204
+ #
1205
+ #
1206
+ # Usage:
1207
+ # Elastics.cluster_nodes_stats :nodes => nil,
1208
+ # :endpoint => nil
1209
+ #
1210
+ def Elastics.cluster_nodes_stats(*vars)
1211
+ ## this is a stub, used for reference
1212
+ super
1213
+ end
1214
+
1215
+ # ########## Elastics.cluster_nodes_shutdown ##########
1216
+ # --------------
1217
+ # Elastics::Template
1218
+ # ---
1219
+ # cluster_nodes_shutdown:
1220
+ # - POST
1221
+ # - /_cluster/nodes/<<nodes= ~ >>/_shutdown
1222
+ #
1223
+ #
1224
+ # Usage:
1225
+ # Elastics.cluster_nodes_shutdown :nodes => nil
1226
+ #
1227
+ def Elastics.cluster_nodes_shutdown(*vars)
1228
+ ## this is a stub, used for reference
1229
+ super
1230
+ end
1231
+
1232
+ # ########## Elastics.cluster_nodes_hot_threads ##########
1233
+ # --------------
1234
+ # Elastics::Template
1235
+ # ---
1236
+ # cluster_nodes_hot_threads:
1237
+ # - GET
1238
+ # - /_nodes/<<nodes= ~ >>/hot_threads
1239
+ #
1240
+ #
1241
+ # Usage:
1242
+ # Elastics.cluster_nodes_hot_threads :nodes => nil
1243
+ #
1244
+ def Elastics.cluster_nodes_hot_threads(*vars)
1245
+ ## this is a stub, used for reference
1246
+ super
1247
+ end
1248
+
1249
+ # ########## Elastics.cluster_reroute ##########
1250
+ # --------------
1251
+ # Elastics::Template
1252
+ # ---
1253
+ # cluster_reroute:
1254
+ # - POST
1255
+ # - /_cluster/reroute
1256
+ #
1257
+ #
1258
+ # Usage:
1259
+ # Elastics.cluster_reroute
1260
+ #
1261
+ def Elastics.cluster_reroute(*vars)
1262
+ ## this is a stub, used for reference
1263
+ super
1264
+ end
1265
+
1266
+
1267
+ end
1268
+ end