elasticsearch-api 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +2 -1
- data/elasticsearch-api.gemspec +6 -1
- data/lib/elasticsearch/api.rb +1 -0
- data/lib/elasticsearch/api/actions/bulk.rb +3 -1
- data/lib/elasticsearch/api/actions/cat/plugins.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/tasks.rb +41 -0
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +3 -0
- data/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +26 -0
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +4 -1
- data/lib/elasticsearch/api/actions/cluster/health.rb +4 -1
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +3 -1
- data/lib/elasticsearch/api/actions/cluster/stats.rb +30 -0
- data/lib/elasticsearch/api/actions/index.rb +1 -0
- data/lib/elasticsearch/api/actions/indices/analyze.rb +5 -0
- data/lib/elasticsearch/api/actions/indices/close.rb +2 -1
- data/lib/elasticsearch/api/actions/indices/create.rb +8 -1
- data/lib/elasticsearch/api/actions/indices/flush_synced.rb +5 -1
- data/lib/elasticsearch/api/actions/indices/get.rb +10 -1
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +2 -0
- data/lib/elasticsearch/api/actions/indices/open.rb +2 -1
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +4 -1
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +6 -0
- data/lib/elasticsearch/api/actions/indices/segments.rb +8 -6
- data/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +29 -0
- data/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +27 -0
- data/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +32 -0
- data/lib/elasticsearch/api/actions/ingest/simulate.rb +29 -0
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +3 -1
- data/lib/elasticsearch/api/actions/nodes/info.rb +4 -2
- data/lib/elasticsearch/api/actions/nodes/stats.rb +3 -1
- data/lib/elasticsearch/api/actions/ping.rb +7 -1
- data/lib/elasticsearch/api/actions/reindex.rb +69 -0
- data/lib/elasticsearch/api/actions/search.rb +5 -0
- data/lib/elasticsearch/api/actions/tasks/list.rb +3 -0
- data/lib/elasticsearch/api/actions/update_by_query.rb +128 -0
- data/lib/elasticsearch/api/namespace/ingest.rb +20 -0
- data/lib/elasticsearch/api/utils.rb +55 -0
- data/lib/elasticsearch/api/version.rb +1 -1
- data/test/integration/yaml_test_runner.rb +3 -3
- data/test/unit/cat/plugins_test.rb +1 -1
- data/test/unit/cat/tasks_test.rb +26 -0
- data/test/unit/cluster/allocation_explain_test.rb +26 -0
- data/test/unit/cluster/health_test.rb +9 -0
- data/test/unit/cluster/pending_tasks_test.rb +1 -1
- data/test/unit/cluster/stats_test.rb +26 -0
- data/test/unit/ingest/delete_pipeline_test.rb +41 -0
- data/test/unit/ingest/get_pipeline_test.rb +41 -0
- data/test/unit/ingest/put_pipeline_test.rb +46 -0
- data/test/unit/ingest/simulate_test.rb +35 -0
- data/test/unit/ping_test.rb +6 -1
- data/test/unit/reindex_test.rb +26 -0
- data/test/unit/update_by_query_test.rb +26 -0
- data/test/unit/utils_test.rb +59 -0
- metadata +34 -6
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Elasticsearch
|
4
|
+
module Test
|
5
|
+
class UpdateByQueryTest < ::Test::Unit::TestCase
|
6
|
+
|
7
|
+
context "Update by query" do
|
8
|
+
subject { FakeClient.new }
|
9
|
+
|
10
|
+
should "perform correct request" do
|
11
|
+
subject.expects(:perform_request).with do |method, url, params, body|
|
12
|
+
assert_equal 'POST', method
|
13
|
+
assert_equal 'foo/_update_by_query', url
|
14
|
+
assert_equal Hash.new, params
|
15
|
+
assert_equal nil, body
|
16
|
+
true
|
17
|
+
end.returns(FakeResponse.new)
|
18
|
+
|
19
|
+
subject.update_by_query :index => 'foo'
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/test/unit/utils_test.rb
CHANGED
@@ -248,6 +248,65 @@ module Elasticsearch
|
|
248
248
|
|
249
249
|
end
|
250
250
|
|
251
|
+
context "__report_unsupported_parameters" do
|
252
|
+
should "print used unsupported parameters passed as Symbols" do
|
253
|
+
arguments = { :foo => 'bar', :moo => 'bam', :baz => 'qux' }
|
254
|
+
unsupported_params = [:foo, :moo]
|
255
|
+
|
256
|
+
STDERR.expects(:puts).with do |message|
|
257
|
+
assert_equal 2, message.split("\n").size
|
258
|
+
true
|
259
|
+
end
|
260
|
+
|
261
|
+
__report_unsupported_parameters(arguments, unsupported_params)
|
262
|
+
end
|
263
|
+
|
264
|
+
should "print used unsupported parameters passed as Hashes" do
|
265
|
+
arguments = { :foo => 'bar', :moo => 'bam', :baz => 'qux' }
|
266
|
+
unsupported_params = [ { :foo => { :explanation => 'NOT_SUPPORTED' } } ]
|
267
|
+
|
268
|
+
STDERR.expects(:puts).with do |message|
|
269
|
+
assert_match /NOT_SUPPORTED/, message
|
270
|
+
assert_equal 1, message.split("\n").size
|
271
|
+
true
|
272
|
+
end
|
273
|
+
|
274
|
+
__report_unsupported_parameters(arguments, unsupported_params)
|
275
|
+
end
|
276
|
+
|
277
|
+
should "print used unsupported parameters passed as a mix of Symbols and Hashes" do
|
278
|
+
arguments = { :foo => 'bar', :moo => 'bam', :baz => 'qux' }
|
279
|
+
unsupported_params = [ { :foo => { :explanation => 'NOT_SUPPORTED'} }, :moo ]
|
280
|
+
|
281
|
+
STDERR.expects(:puts).with do |message|
|
282
|
+
assert_match /NOT_SUPPORTED/, message
|
283
|
+
assert_equal 2, message.split("\n").size
|
284
|
+
true
|
285
|
+
end
|
286
|
+
|
287
|
+
__report_unsupported_parameters(arguments, unsupported_params)
|
288
|
+
end
|
289
|
+
|
290
|
+
should "not print unused unsupported parameters" do
|
291
|
+
arguments = { :moo => 'bam', :baz => 'qux' }
|
292
|
+
unsupported_params = [:foo]
|
293
|
+
|
294
|
+
STDERR.expects(:puts).never
|
295
|
+
|
296
|
+
__report_unsupported_parameters(arguments, unsupported_params)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
300
|
+
context "__report_unsupported_method" do
|
301
|
+
should "print the warning" do
|
302
|
+
STDERR.expects(:puts).with do |message|
|
303
|
+
assert_match /foo/, message
|
304
|
+
true
|
305
|
+
end
|
306
|
+
|
307
|
+
__report_unsupported_method(:foo)
|
308
|
+
end
|
309
|
+
end
|
251
310
|
end
|
252
311
|
end
|
253
312
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticsearch-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karel Minarik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '11.
|
47
|
+
version: '11.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '11.
|
54
|
+
version: '11.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: elasticsearch
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -370,14 +370,17 @@ files:
|
|
370
370
|
- lib/elasticsearch/api/actions/cat/segments.rb
|
371
371
|
- lib/elasticsearch/api/actions/cat/shards.rb
|
372
372
|
- lib/elasticsearch/api/actions/cat/snapshots.rb
|
373
|
+
- lib/elasticsearch/api/actions/cat/tasks.rb
|
373
374
|
- lib/elasticsearch/api/actions/cat/thread_pool.rb
|
374
375
|
- lib/elasticsearch/api/actions/clear_scroll.rb
|
376
|
+
- lib/elasticsearch/api/actions/cluster/allocation_explain.rb
|
375
377
|
- lib/elasticsearch/api/actions/cluster/get_settings.rb
|
376
378
|
- lib/elasticsearch/api/actions/cluster/health.rb
|
377
379
|
- lib/elasticsearch/api/actions/cluster/pending_tasks.rb
|
378
380
|
- lib/elasticsearch/api/actions/cluster/put_settings.rb
|
379
381
|
- lib/elasticsearch/api/actions/cluster/reroute.rb
|
380
382
|
- lib/elasticsearch/api/actions/cluster/state.rb
|
383
|
+
- lib/elasticsearch/api/actions/cluster/stats.rb
|
381
384
|
- lib/elasticsearch/api/actions/count.rb
|
382
385
|
- lib/elasticsearch/api/actions/count_percolate.rb
|
383
386
|
- lib/elasticsearch/api/actions/create.rb
|
@@ -436,6 +439,10 @@ files:
|
|
436
439
|
- lib/elasticsearch/api/actions/indices/upgrade.rb
|
437
440
|
- lib/elasticsearch/api/actions/indices/validate_query.rb
|
438
441
|
- lib/elasticsearch/api/actions/info.rb
|
442
|
+
- lib/elasticsearch/api/actions/ingest/delete_pipeline.rb
|
443
|
+
- lib/elasticsearch/api/actions/ingest/get_pipeline.rb
|
444
|
+
- lib/elasticsearch/api/actions/ingest/put_pipeline.rb
|
445
|
+
- lib/elasticsearch/api/actions/ingest/simulate.rb
|
439
446
|
- lib/elasticsearch/api/actions/list_benchmarks.rb
|
440
447
|
- lib/elasticsearch/api/actions/mget.rb
|
441
448
|
- lib/elasticsearch/api/actions/mlt.rb
|
@@ -450,6 +457,7 @@ files:
|
|
450
457
|
- lib/elasticsearch/api/actions/ping.rb
|
451
458
|
- lib/elasticsearch/api/actions/put_script.rb
|
452
459
|
- lib/elasticsearch/api/actions/put_template.rb
|
460
|
+
- lib/elasticsearch/api/actions/reindex.rb
|
453
461
|
- lib/elasticsearch/api/actions/render_search_template.rb
|
454
462
|
- lib/elasticsearch/api/actions/scroll.rb
|
455
463
|
- lib/elasticsearch/api/actions/search.rb
|
@@ -470,10 +478,12 @@ files:
|
|
470
478
|
- lib/elasticsearch/api/actions/tasks/list.rb
|
471
479
|
- lib/elasticsearch/api/actions/termvectors.rb
|
472
480
|
- lib/elasticsearch/api/actions/update.rb
|
481
|
+
- lib/elasticsearch/api/actions/update_by_query.rb
|
473
482
|
- lib/elasticsearch/api/namespace/cat.rb
|
474
483
|
- lib/elasticsearch/api/namespace/cluster.rb
|
475
484
|
- lib/elasticsearch/api/namespace/common.rb
|
476
485
|
- lib/elasticsearch/api/namespace/indices.rb
|
486
|
+
- lib/elasticsearch/api/namespace/ingest.rb
|
477
487
|
- lib/elasticsearch/api/namespace/nodes.rb
|
478
488
|
- lib/elasticsearch/api/namespace/snapshot.rb
|
479
489
|
- lib/elasticsearch/api/namespace/tasks.rb
|
@@ -502,15 +512,18 @@ files:
|
|
502
512
|
- test/unit/cat/segments_test.rb
|
503
513
|
- test/unit/cat/shards_test.rb
|
504
514
|
- test/unit/cat/snapshots_test.rb
|
515
|
+
- test/unit/cat/tasks_test.rb
|
505
516
|
- test/unit/cat/thread_pool_test.rb
|
506
517
|
- test/unit/clear_scroll_test.rb
|
507
518
|
- test/unit/client_test.rb
|
519
|
+
- test/unit/cluster/allocation_explain_test.rb
|
508
520
|
- test/unit/cluster/get_settings_test.rb
|
509
521
|
- test/unit/cluster/health_test.rb
|
510
522
|
- test/unit/cluster/pending_tasks_test.rb
|
511
523
|
- test/unit/cluster/put_settings_test.rb
|
512
524
|
- test/unit/cluster/reroute_test.rb
|
513
525
|
- test/unit/cluster/state_test.rb
|
526
|
+
- test/unit/cluster/stats_test.rb
|
514
527
|
- test/unit/count_percolate_test.rb
|
515
528
|
- test/unit/count_test.rb
|
516
529
|
- test/unit/create_document_test.rb
|
@@ -570,6 +583,10 @@ files:
|
|
570
583
|
- test/unit/indices/upgrade_test.rb
|
571
584
|
- test/unit/indices/validate_query_test.rb
|
572
585
|
- test/unit/info_test.rb
|
586
|
+
- test/unit/ingest/delete_pipeline_test.rb
|
587
|
+
- test/unit/ingest/get_pipeline_test.rb
|
588
|
+
- test/unit/ingest/put_pipeline_test.rb
|
589
|
+
- test/unit/ingest/simulate_test.rb
|
573
590
|
- test/unit/json_builders_test.rb
|
574
591
|
- test/unit/list_benchmarks_test.rb
|
575
592
|
- test/unit/mget_test.rb
|
@@ -585,6 +602,7 @@ files:
|
|
585
602
|
- test/unit/ping_test.rb
|
586
603
|
- test/unit/put_script_test.rb
|
587
604
|
- test/unit/put_template_test.rb
|
605
|
+
- test/unit/reindex_test.rb
|
588
606
|
- test/unit/render_search_template_test.rb
|
589
607
|
- test/unit/scroll_test.rb
|
590
608
|
- test/unit/search_exists_test.rb
|
@@ -604,6 +622,7 @@ files:
|
|
604
622
|
- test/unit/tasks/cancel_test.rb
|
605
623
|
- test/unit/tasks/list_test.rb
|
606
624
|
- test/unit/termvectors_test.rb
|
625
|
+
- test/unit/update_by_query_test.rb
|
607
626
|
- test/unit/update_document_test.rb
|
608
627
|
- test/unit/utils_test.rb
|
609
628
|
- utils/Gemfile
|
@@ -663,15 +682,18 @@ test_files:
|
|
663
682
|
- test/unit/cat/segments_test.rb
|
664
683
|
- test/unit/cat/shards_test.rb
|
665
684
|
- test/unit/cat/snapshots_test.rb
|
685
|
+
- test/unit/cat/tasks_test.rb
|
666
686
|
- test/unit/cat/thread_pool_test.rb
|
667
687
|
- test/unit/clear_scroll_test.rb
|
668
688
|
- test/unit/client_test.rb
|
689
|
+
- test/unit/cluster/allocation_explain_test.rb
|
669
690
|
- test/unit/cluster/get_settings_test.rb
|
670
691
|
- test/unit/cluster/health_test.rb
|
671
692
|
- test/unit/cluster/pending_tasks_test.rb
|
672
693
|
- test/unit/cluster/put_settings_test.rb
|
673
694
|
- test/unit/cluster/reroute_test.rb
|
674
695
|
- test/unit/cluster/state_test.rb
|
696
|
+
- test/unit/cluster/stats_test.rb
|
675
697
|
- test/unit/count_percolate_test.rb
|
676
698
|
- test/unit/count_test.rb
|
677
699
|
- test/unit/create_document_test.rb
|
@@ -731,6 +753,10 @@ test_files:
|
|
731
753
|
- test/unit/indices/upgrade_test.rb
|
732
754
|
- test/unit/indices/validate_query_test.rb
|
733
755
|
- test/unit/info_test.rb
|
756
|
+
- test/unit/ingest/delete_pipeline_test.rb
|
757
|
+
- test/unit/ingest/get_pipeline_test.rb
|
758
|
+
- test/unit/ingest/put_pipeline_test.rb
|
759
|
+
- test/unit/ingest/simulate_test.rb
|
734
760
|
- test/unit/json_builders_test.rb
|
735
761
|
- test/unit/list_benchmarks_test.rb
|
736
762
|
- test/unit/mget_test.rb
|
@@ -746,6 +772,7 @@ test_files:
|
|
746
772
|
- test/unit/ping_test.rb
|
747
773
|
- test/unit/put_script_test.rb
|
748
774
|
- test/unit/put_template_test.rb
|
775
|
+
- test/unit/reindex_test.rb
|
749
776
|
- test/unit/render_search_template_test.rb
|
750
777
|
- test/unit/scroll_test.rb
|
751
778
|
- test/unit/search_exists_test.rb
|
@@ -765,6 +792,7 @@ test_files:
|
|
765
792
|
- test/unit/tasks/cancel_test.rb
|
766
793
|
- test/unit/tasks/list_test.rb
|
767
794
|
- test/unit/termvectors_test.rb
|
795
|
+
- test/unit/update_by_query_test.rb
|
768
796
|
- test/unit/update_document_test.rb
|
769
797
|
- test/unit/utils_test.rb
|
770
798
|
has_rdoc:
|