elasticsearch-api 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 290d056e39c6c7ec0128c0ed68246261b8fb25a2
4
- data.tar.gz: cf0c25e640e3d797eed9dc726cb3810534d529b1
3
+ metadata.gz: 3768e622d02b04ed6d2f34897589f64b16a353c7
4
+ data.tar.gz: 3e26771c0bf181965151263cfa62f5fd3ab30324
5
5
  SHA512:
6
- metadata.gz: befb5b52983972c74cccc3fbefd048bc67e937714a2836ad8a9efc20e533b6dbca253929faf8d107aa4f47066e430218ae90ec2d7058938aceb7d2173eea7407
7
- data.tar.gz: d59c46726402fca26409e760738cd4b5db230ae0877b7abf493ad719fbc40f65e46aa1f89d2a8fca28e538067f0a50143c3cd40009b81bd9154703f6b987feb6
6
+ metadata.gz: de3b63d3e1f60333d4c95b6ab0c45b2963ab04075a0ba8f83250a4331d16592e9732bbe993f5b98230c24bb1bf36abf9c596f9999891e6c7751bf7ca213f0fee
7
+ data.tar.gz: 1f15eec971262a774e988126bb90ef36676d8b8f16d4a22251c24b80c8eca78dd530de6ce758b226fc3f8a5d3a5431deee46f6deeb4bf2ddab3485426a409d27
@@ -48,9 +48,6 @@ module Elasticsearch
48
48
  :help,
49
49
  :v ]
50
50
 
51
- unsupported_params = [ :format ]
52
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
53
-
54
51
  name = arguments.delete(:name)
55
52
 
56
53
  method = HTTP_GET
@@ -50,9 +50,6 @@ module Elasticsearch
50
50
  :help,
51
51
  :v ]
52
52
 
53
- unsupported_params = [ :format ]
54
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
55
-
56
53
  node_id = arguments.delete(:node_id)
57
54
 
58
55
  method = HTTP_GET
@@ -44,9 +44,6 @@ module Elasticsearch
44
44
  :help,
45
45
  :v ]
46
46
 
47
- unsupported_params = [ :format ]
48
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
49
-
50
47
  index = arguments.delete(:index)
51
48
 
52
49
  method = HTTP_GET
@@ -34,9 +34,6 @@ module Elasticsearch
34
34
  :v,
35
35
  :fields ]
36
36
 
37
- unsupported_params = [ :format ]
38
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
39
-
40
37
  fields = arguments.delete(:fields)
41
38
 
42
39
  method = HTTP_GET
@@ -37,9 +37,6 @@ module Elasticsearch
37
37
  :ts,
38
38
  :v ]
39
39
 
40
- unsupported_params = [ :format ]
41
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
42
-
43
40
  method = HTTP_GET
44
41
  path = "_cat/health"
45
42
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -58,9 +58,6 @@ module Elasticsearch
58
58
  :pri,
59
59
  :v ]
60
60
 
61
- unsupported_params = [ :format ]
62
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
63
-
64
61
  index = arguments.delete(:index)
65
62
 
66
63
  method = HTTP_GET
@@ -35,9 +35,6 @@ module Elasticsearch
35
35
  :help,
36
36
  :v ]
37
37
 
38
- unsupported_params = [ :format ]
39
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
40
-
41
38
  method = HTTP_GET
42
39
  path = "_cat/master"
43
40
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -43,9 +43,6 @@ module Elasticsearch
43
43
  :help,
44
44
  :v ]
45
45
 
46
- unsupported_params = [ :format ]
47
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
48
-
49
46
  method = HTTP_GET
50
47
  path = "_cat/nodes"
51
48
 
@@ -35,9 +35,6 @@ module Elasticsearch
35
35
  :help,
36
36
  :v ]
37
37
 
38
- unsupported_params = [ :format ]
39
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
40
-
41
38
  method = HTTP_GET
42
39
  path = "_cat/pending_tasks"
43
40
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -22,9 +22,6 @@ module Elasticsearch
22
22
  :help,
23
23
  :v ]
24
24
 
25
- unsupported_params = [ :format ]
26
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
27
-
28
25
  method = HTTP_GET
29
26
  path = "_cat/plugins"
30
27
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -54,9 +54,6 @@ module Elasticsearch
54
54
  :help,
55
55
  :v ]
56
56
 
57
- unsupported_params = [ :format ]
58
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
59
-
60
57
  index = arguments.delete(:index)
61
58
 
62
59
  method = HTTP_GET
@@ -24,9 +24,6 @@ module Elasticsearch
24
24
  :help,
25
25
  :v ]
26
26
 
27
- unsupported_params = [ :format ]
28
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
29
-
30
27
  method = HTTP_GET
31
28
  path = "_cat/segments"
32
29
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -58,9 +58,6 @@ module Elasticsearch
58
58
  :help,
59
59
  :v ]
60
60
 
61
- unsupported_params = [ :format ]
62
- Utils.__report_unsupported_parameters(arguments.keys, unsupported_params)
63
-
64
61
  index = arguments.delete(:index)
65
62
 
66
63
  method = HTTP_GET
@@ -13,9 +13,12 @@ module Elasticsearch
13
13
  #
14
14
  # client.indices.validate_query index: 'myindex', q: '[[[ BOOM! ]]]', explain: true
15
15
  #
16
- # @example Validate a DSL query (with explanation)
16
+ # @example Validate a DSL query (with explanation and rewrite). With rewrite set to true, the
17
+ # explanation is more detailed showing the actual Lucene query that will
18
+ # be executed.
17
19
  #
18
20
  # client.indices.validate_query index: 'myindex',
21
+ # rewrite: true,
19
22
  # explain: true,
20
23
  # body: {
21
24
  # filtered: {
@@ -64,6 +67,7 @@ module Elasticsearch
64
67
  #
65
68
  def validate_query(arguments={})
66
69
  valid_params = [
70
+ :rewrite,
67
71
  :explain,
68
72
  :ignore_unavailable,
69
73
  :allow_no_indices,
@@ -2,7 +2,7 @@ module Elasticsearch
2
2
  module API
3
3
  module Actions
4
4
 
5
- # Returns true if the cluster returns a sucessfull HTTP response, false otherwise.
5
+ # Returns true if the cluster returns a successful HTTP response, false otherwise.
6
6
  #
7
7
  # @example
8
8
  #
@@ -7,7 +7,8 @@ module Elasticsearch
7
7
  # When using `from` and `size` to return a large result sets, performance drops as you "paginate" in the set,
8
8
  # and you can't guarantee the consistency when the index is being updated at the same time.
9
9
  #
10
- # "Scrolling" the results is frequently used with the `scan` search type.
10
+ # The "Scroll" API uses a "point in time" snapshot of the index state, which was created via a "Search" API
11
+ # request specifying the `scroll` parameter.
11
12
  #
12
13
  # @example A basic example
13
14
  #
@@ -24,8 +25,13 @@ module Elasticsearch
24
25
  # 1_000.times do |i| client.index index: 'test', type: 'test', id: i+1, body: {title: "Test #{i}"} end
25
26
  # client.indices.refresh index: 'test'
26
27
  #
27
- # # Open the "view" of the index with the `scan` search_type
28
- # r = client.search index: 'test', search_type: 'scan', scroll: '5m', size: 10
28
+ # # Open the "view" of the index by passing the `scroll` parameter
29
+ # # Sorting by `_doc` makes the operations faster
30
+ # r = client.search index: 'test', scroll: '1m', body: {sort: ['_doc']}
31
+ #
32
+ # # Display the initial results
33
+ # puts "--- BATCH 0 -------------------------------------------------"
34
+ # puts r['hits']['hits'].map { |d| d['_source']['title'] }.inspect
29
35
  #
30
36
  # # Call the `scroll` API until empty results are returned
31
37
  # while r = client.scroll(scroll_id: r['_scroll_id'], scroll: '5m') and not r['hits']['hits'].empty? do
@@ -235,7 +235,7 @@ module Elasticsearch
235
235
  end
236
236
 
237
237
  unless messages.empty?
238
- if terminal = STDERR.tty?
238
+ if STDERR.tty?
239
239
  STDERR.puts messages.map { |m| "\e[31;1m#{m}\e[0m" }.join("\n")
240
240
  else
241
241
  STDERR.puts messages.join("\n")
@@ -251,11 +251,11 @@ module Elasticsearch
251
251
 
252
252
  message += ". This method is not supported in the version you're using: #{Elasticsearch::API::VERSION}, and will be removed in the next release."
253
253
 
254
- if terminal = STDERR.tty?
255
- STDERR.puts "\e[31;1m#{message}\e[0m"
256
- else
257
- STDERR.puts message
258
- end
254
+ if STDERR.tty?
255
+ STDERR.puts "\e[31;1m#{message}\e[0m"
256
+ else
257
+ STDERR.puts message
258
+ end
259
259
  end
260
260
 
261
261
  extend self
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module API
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
@@ -258,7 +258,8 @@ module Elasticsearch
258
258
 
259
259
  # Skip features
260
260
  elsif skip && skip['skip']['features']
261
- if (skip['skip']['features'].split(',') & SKIP_FEATURES.split(',') ).size > 0
261
+ skip_features = skip['skip']['features'].respond_to?(:split) ? skip['skip']['features'].split(',') : skip['skip']['features']
262
+ if ( skip_features & SKIP_FEATURES.split(',') ).size > 0
262
263
  return skip['skip']['features']
263
264
  end
264
265
  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: 2.0.0
4
+ version: 2.0.1
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-07-20 00:00:00.000000000 Z
11
+ date: 2017-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -795,4 +795,3 @@ test_files:
795
795
  - test/unit/update_by_query_test.rb
796
796
  - test/unit/update_document_test.rb
797
797
  - test/unit/utils_test.rb
798
- has_rdoc: