elasticsearch-api 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -0
  3. data/Rakefile +3 -3
  4. data/elasticsearch-api.gemspec +4 -1
  5. data/lib/elasticsearch/api.rb +19 -0
  6. data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -1
  7. data/lib/elasticsearch/api/actions/benchmark.rb +1 -1
  8. data/lib/elasticsearch/api/actions/bulk.rb +1 -1
  9. data/lib/elasticsearch/api/actions/cat/aliases.rb +1 -1
  10. data/lib/elasticsearch/api/actions/cat/allocation.rb +1 -1
  11. data/lib/elasticsearch/api/actions/cat/count.rb +1 -1
  12. data/lib/elasticsearch/api/actions/cat/fielddata.rb +1 -1
  13. data/lib/elasticsearch/api/actions/cat/health.rb +1 -1
  14. data/lib/elasticsearch/api/actions/cat/help.rb +1 -1
  15. data/lib/elasticsearch/api/actions/cat/indices.rb +1 -1
  16. data/lib/elasticsearch/api/actions/cat/master.rb +1 -1
  17. data/lib/elasticsearch/api/actions/cat/nodes.rb +1 -1
  18. data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +1 -1
  19. data/lib/elasticsearch/api/actions/cat/recovery.rb +1 -1
  20. data/lib/elasticsearch/api/actions/cat/segments.rb +34 -0
  21. data/lib/elasticsearch/api/actions/cat/shards.rb +1 -1
  22. data/lib/elasticsearch/api/actions/cat/thread_pool.rb +1 -1
  23. data/lib/elasticsearch/api/actions/clear_scroll.rb +12 -3
  24. data/lib/elasticsearch/api/actions/cluster/get_settings.rb +1 -1
  25. data/lib/elasticsearch/api/actions/cluster/health.rb +1 -1
  26. data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +1 -1
  27. data/lib/elasticsearch/api/actions/cluster/put_settings.rb +1 -1
  28. data/lib/elasticsearch/api/actions/cluster/reroute.rb +1 -1
  29. data/lib/elasticsearch/api/actions/cluster/state.rb +8 -2
  30. data/lib/elasticsearch/api/actions/count.rb +1 -1
  31. data/lib/elasticsearch/api/actions/count_percolate.rb +1 -1
  32. data/lib/elasticsearch/api/actions/delete.rb +1 -1
  33. data/lib/elasticsearch/api/actions/delete_by_query.rb +1 -1
  34. data/lib/elasticsearch/api/actions/delete_script.rb +1 -1
  35. data/lib/elasticsearch/api/actions/delete_template.rb +1 -1
  36. data/lib/elasticsearch/api/actions/exists.rb +4 -2
  37. data/lib/elasticsearch/api/actions/explain.rb +1 -1
  38. data/lib/elasticsearch/api/actions/get.rb +2 -2
  39. data/lib/elasticsearch/api/actions/get_script.rb +1 -1
  40. data/lib/elasticsearch/api/actions/get_source.rb +2 -2
  41. data/lib/elasticsearch/api/actions/get_template.rb +1 -1
  42. data/lib/elasticsearch/api/actions/index.rb +1 -1
  43. data/lib/elasticsearch/api/actions/indices/analyze.rb +5 -3
  44. data/lib/elasticsearch/api/actions/indices/clear_cache.rb +1 -1
  45. data/lib/elasticsearch/api/actions/indices/close.rb +1 -1
  46. data/lib/elasticsearch/api/actions/indices/create.rb +1 -1
  47. data/lib/elasticsearch/api/actions/indices/delete.rb +7 -1
  48. data/lib/elasticsearch/api/actions/indices/delete_alias.rb +1 -1
  49. data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +1 -1
  50. data/lib/elasticsearch/api/actions/indices/delete_template.rb +1 -1
  51. data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +1 -1
  52. data/lib/elasticsearch/api/actions/indices/exists.rb +3 -1
  53. data/lib/elasticsearch/api/actions/indices/exists_alias.rb +3 -1
  54. data/lib/elasticsearch/api/actions/indices/exists_template.rb +3 -2
  55. data/lib/elasticsearch/api/actions/indices/exists_type.rb +3 -1
  56. data/lib/elasticsearch/api/actions/indices/flush.rb +1 -1
  57. data/lib/elasticsearch/api/actions/indices/get.rb +1 -1
  58. data/lib/elasticsearch/api/actions/indices/get_alias.rb +1 -1
  59. data/lib/elasticsearch/api/actions/indices/get_aliases.rb +1 -1
  60. data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +1 -1
  61. data/lib/elasticsearch/api/actions/indices/get_mapping.rb +1 -1
  62. data/lib/elasticsearch/api/actions/indices/get_settings.rb +1 -1
  63. data/lib/elasticsearch/api/actions/indices/get_template.rb +3 -2
  64. data/lib/elasticsearch/api/actions/indices/get_warmer.rb +1 -1
  65. data/lib/elasticsearch/api/actions/indices/open.rb +1 -1
  66. data/lib/elasticsearch/api/actions/indices/optimize.rb +1 -1
  67. data/lib/elasticsearch/api/actions/indices/put_alias.rb +2 -2
  68. data/lib/elasticsearch/api/actions/indices/put_mapping.rb +1 -1
  69. data/lib/elasticsearch/api/actions/indices/put_settings.rb +1 -1
  70. data/lib/elasticsearch/api/actions/indices/put_template.rb +1 -1
  71. data/lib/elasticsearch/api/actions/indices/put_warmer.rb +1 -1
  72. data/lib/elasticsearch/api/actions/indices/recovery.rb +1 -1
  73. data/lib/elasticsearch/api/actions/indices/refresh.rb +1 -1
  74. data/lib/elasticsearch/api/actions/indices/segments.rb +1 -1
  75. data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +1 -1
  76. data/lib/elasticsearch/api/actions/indices/stats.rb +1 -1
  77. data/lib/elasticsearch/api/actions/indices/status.rb +1 -1
  78. data/lib/elasticsearch/api/actions/indices/update_aliases.rb +1 -1
  79. data/lib/elasticsearch/api/actions/indices/upgrade.rb +1 -1
  80. data/lib/elasticsearch/api/actions/indices/validate_query.rb +1 -1
  81. data/lib/elasticsearch/api/actions/info.rb +1 -1
  82. data/lib/elasticsearch/api/actions/list_benchmarks.rb +1 -1
  83. data/lib/elasticsearch/api/actions/mget.rb +1 -1
  84. data/lib/elasticsearch/api/actions/mlt.rb +1 -1
  85. data/lib/elasticsearch/api/actions/mpercolate.rb +1 -1
  86. data/lib/elasticsearch/api/actions/msearch.rb +1 -1
  87. data/lib/elasticsearch/api/actions/mtermvectors.rb +1 -1
  88. data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +1 -1
  89. data/lib/elasticsearch/api/actions/nodes/info.rb +18 -2
  90. data/lib/elasticsearch/api/actions/nodes/shutdown.rb +1 -1
  91. data/lib/elasticsearch/api/actions/nodes/stats.rb +1 -1
  92. data/lib/elasticsearch/api/actions/percolate.rb +4 -5
  93. data/lib/elasticsearch/api/actions/ping.rb +1 -1
  94. data/lib/elasticsearch/api/actions/put_script.rb +1 -1
  95. data/lib/elasticsearch/api/actions/put_template.rb +1 -1
  96. data/lib/elasticsearch/api/actions/scroll.rb +2 -2
  97. data/lib/elasticsearch/api/actions/search.rb +4 -3
  98. data/lib/elasticsearch/api/actions/search_shards.rb +1 -1
  99. data/lib/elasticsearch/api/actions/search_template.rb +1 -1
  100. data/lib/elasticsearch/api/actions/snapshot/create.rb +1 -1
  101. data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +1 -1
  102. data/lib/elasticsearch/api/actions/snapshot/delete.rb +1 -1
  103. data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +1 -1
  104. data/lib/elasticsearch/api/actions/snapshot/get.rb +1 -1
  105. data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +1 -1
  106. data/lib/elasticsearch/api/actions/snapshot/restore.rb +1 -1
  107. data/lib/elasticsearch/api/actions/snapshot/status.rb +1 -1
  108. data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +1 -1
  109. data/lib/elasticsearch/api/actions/suggest.rb +1 -1
  110. data/lib/elasticsearch/api/actions/{termvector.rb → termvectors.rb} +24 -7
  111. data/lib/elasticsearch/api/actions/update.rb +1 -1
  112. data/lib/elasticsearch/api/utils.rb +27 -6
  113. data/lib/elasticsearch/api/version.rb +1 -1
  114. data/test/integration/yaml_test_runner.rb +3 -2
  115. data/test/unit/api_test.rb +24 -0
  116. data/test/unit/cat/segments_test.rb +26 -0
  117. data/test/unit/clear_scroll_test.rb +4 -4
  118. data/test/unit/exists_document_test.rb +5 -0
  119. data/test/unit/indices/delete_test.rb +7 -0
  120. data/test/unit/indices/exists_alias_test.rb +5 -0
  121. data/test/unit/indices/exists_test.rb +5 -0
  122. data/test/unit/indices/exists_type_test.rb +5 -0
  123. data/test/unit/indices/put_alias_test.rb +9 -0
  124. data/test/unit/nodes/info_test.rb +9 -0
  125. data/test/unit/scroll_test.rb +1 -2
  126. data/test/unit/{termvector_test.rb → termvectors_test.rb} +15 -12
  127. data/test/unit/utils_test.rb +22 -0
  128. data/utils/Gemfile +9 -0
  129. data/utils/Thorfile +3 -0
  130. data/utils/thor/generate_api.rb +189 -0
  131. data/utils/thor/generate_source.rb +122 -0
  132. data/utils/thor/lister.rb +41 -0
  133. data/utils/thor/templates/ruby/method.erb +62 -0
  134. data/utils/thor/templates/ruby/test.erb +26 -0
  135. data/utils/thor/templates/ruby/test_helper.rb +71 -0
  136. metadata +18 -5
@@ -53,7 +53,7 @@ module Elasticsearch
53
53
  :flat_settings
54
54
  ]
55
55
 
56
- method = 'PUT'
56
+ method = HTTP_PUT
57
57
  path = Utils.__pathify Utils.__listify(arguments[:index]), '_settings'
58
58
  params = Utils.__validate_and_extract_params arguments, valid_params
59
59
  body = arguments[:body]
@@ -26,7 +26,7 @@ module Elasticsearch
26
26
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
27
27
  valid_params = [ :create, :order, :timeout ]
28
28
 
29
- method = 'PUT'
29
+ method = HTTP_PUT
30
30
  path = Utils.__pathify '_template', Utils.__escape(arguments[:name])
31
31
 
32
32
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -48,7 +48,7 @@ module Elasticsearch
48
48
  :expand_wildcards
49
49
  ]
50
50
 
51
- method = 'PUT'
51
+ method = HTTP_PUT
52
52
  path = Utils.__pathify( Utils.__listify(arguments[:index]),
53
53
  Utils.__listify(arguments[:type]),
54
54
  '_warmer',
@@ -29,7 +29,7 @@ module Elasticsearch
29
29
  :detailed,
30
30
  :active_only,
31
31
  :human ]
32
- method = 'GET'
32
+ method = HTTP_GET
33
33
  path = Utils.__pathify Utils.__listify(arguments[:index]), '_recovery'
34
34
  params = Utils.__validate_and_extract_params arguments, valid_params
35
35
  body = nil
@@ -40,7 +40,7 @@ module Elasticsearch
40
40
  :expand_wildcards
41
41
  ]
42
42
 
43
- method = 'POST'
43
+ method = HTTP_POST
44
44
  path = Utils.__pathify Utils.__listify(arguments[:index]), '_refresh'
45
45
 
46
46
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -30,7 +30,7 @@ module Elasticsearch
30
30
  :expand_wildcards
31
31
  ]
32
32
 
33
- method = 'GET'
33
+ method = HTTP_GET
34
34
  path = Utils.__pathify Utils.__listify(arguments[:index]), '_segments'
35
35
 
36
36
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -29,7 +29,7 @@ module Elasticsearch
29
29
  :expand_wildcards
30
30
  ]
31
31
 
32
- method = 'POST'
32
+ method = HTTP_POST
33
33
  path = Utils.__pathify Utils.__listify(arguments[:index]), '_gateway/snapshot'
34
34
 
35
35
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -101,7 +101,7 @@ module Elasticsearch
101
101
  :allow_no_indices,
102
102
  :expand_wildcards ]
103
103
 
104
- method = 'GET'
104
+ method = HTTP_GET
105
105
 
106
106
  parts = Utils.__extract_parts arguments, valid_parts
107
107
  path = Utils.__pathify Utils.__listify(arguments[:index]), '_stats', Utils.__listify(parts)
@@ -42,7 +42,7 @@ module Elasticsearch
42
42
  :recovery,
43
43
  :snapshot ]
44
44
 
45
- method = 'GET'
45
+ method = HTTP_GET
46
46
  path = Utils.__pathify Utils.__listify(arguments[:index]), '_status'
47
47
 
48
48
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -34,7 +34,7 @@ module Elasticsearch
34
34
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
35
35
  valid_params = [ :timeout ]
36
36
 
37
- method = 'POST'
37
+ method = HTTP_POST
38
38
  path = "_aliases"
39
39
 
40
40
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -25,7 +25,7 @@ module Elasticsearch
25
25
  :expand_wildcards,
26
26
  :wait_for_completion ]
27
27
 
28
- method = 'POST'
28
+ method = HTTP_POST
29
29
  path = "_upgrade"
30
30
  params = Utils.__validate_and_extract_params arguments, valid_params
31
31
  body = nil
@@ -64,7 +64,7 @@ module Elasticsearch
64
64
  :expand_wildcards,
65
65
  :source ]
66
66
 
67
- method = 'GET'
67
+ method = HTTP_GET
68
68
  path = Utils.__pathify Utils.__listify(arguments[:index]),
69
69
  Utils.__listify(arguments[:type]),
70
70
  '_validate/query'
@@ -7,7 +7,7 @@ module Elasticsearch
7
7
  # @see http://elasticsearch.org/guide/
8
8
  #
9
9
  def info(arguments={})
10
- method = 'GET'
10
+ method = HTTP_GET
11
11
  path = ""
12
12
  params = {}
13
13
  body = nil
@@ -17,7 +17,7 @@ module Elasticsearch
17
17
  def list_benchmarks(arguments={})
18
18
  valid_params = [
19
19
  ]
20
- method = 'GET'
20
+ method = HTTP_GET
21
21
  path = "_bench"
22
22
  params = {}
23
23
  body = nil
@@ -57,7 +57,7 @@ module Elasticsearch
57
57
  :_source_include,
58
58
  :_source_exclude ]
59
59
 
60
- method = 'GET'
60
+ method = HTTP_GET
61
61
  path = Utils.__pathify Utils.__escape(arguments[:index]),
62
62
  Utils.__escape(arguments[:type]),
63
63
  '_mget'
@@ -107,7 +107,7 @@ module Elasticsearch
107
107
  :search_types,
108
108
  :stop_words ]
109
109
 
110
- method = 'GET'
110
+ method = HTTP_GET
111
111
  path = Utils.__pathify Utils.__escape(arguments[:index]),
112
112
  Utils.__escape(arguments[:type]),
113
113
  Utils.__escape(arguments[:id]),
@@ -36,7 +36,7 @@ module Elasticsearch
36
36
  :allow_no_indices,
37
37
  :expand_wildcards ]
38
38
 
39
- method = 'GET'
39
+ method = HTTP_GET
40
40
  path = "_mpercolate"
41
41
 
42
42
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -39,7 +39,7 @@ module Elasticsearch
39
39
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
40
40
  valid_params = [ :search_type ]
41
41
 
42
- method = 'GET'
42
+ method = HTTP_GET
43
43
  path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '_msearch' )
44
44
 
45
45
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -50,7 +50,7 @@ module Elasticsearch
50
50
 
51
51
  ids = arguments.delete(:ids)
52
52
 
53
- method = 'GET'
53
+ method = HTTP_GET
54
54
  path = Utils.__pathify Utils.__escape(arguments[:index]),
55
55
  Utils.__escape(arguments[:type]),
56
56
  '_mtermvectors'
@@ -32,7 +32,7 @@ module Elasticsearch
32
32
  :threads,
33
33
  :type ]
34
34
 
35
- method = 'GET'
35
+ method = HTTP_GET
36
36
  path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), 'hot_threads'
37
37
 
38
38
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -14,6 +14,14 @@ module Elasticsearch
14
14
  #
15
15
  # client.nodes.info jvm: true
16
16
  #
17
+ # @example Return information about HTTP and network
18
+ #
19
+ # client.nodes.info http: true, network: true
20
+ #
21
+ # @example Pass a list of metrics
22
+ #
23
+ # client.nodes.info metric: ['http', 'network']
24
+ #
17
25
  # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information;
18
26
  # use `_local` to return information from the node you're connecting to, leave
19
27
  # empty to get information from all nodes
@@ -31,6 +39,9 @@ module Elasticsearch
31
39
  # @see http://elasticsearch.org/guide/reference/api/admin-cluster-nodes-info/
32
40
  #
33
41
  def info(arguments={})
42
+ arguments = arguments.clone
43
+ metric = arguments.delete(:metric)
44
+
34
45
  valid_parts = [
35
46
  :_all,
36
47
  :http,
@@ -45,9 +56,14 @@ module Elasticsearch
45
56
 
46
57
  valid_params = []
47
58
 
48
- method = 'GET'
59
+ method = HTTP_GET
60
+
61
+ if metric
62
+ parts = metric
63
+ else
64
+ parts = Utils.__extract_parts arguments, valid_parts
65
+ end
49
66
 
50
- parts = Utils.__extract_parts arguments, valid_parts
51
67
  path = Utils.__pathify '_nodes', Utils.__listify(arguments[:node_id]), Utils.__listify(parts)
52
68
 
53
69
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -22,7 +22,7 @@ module Elasticsearch
22
22
  :delay,
23
23
  :exit ]
24
24
 
25
- method = 'POST'
25
+ method = HTTP_POST
26
26
  path = Utils.__pathify '_cluster/nodes', Utils.__listify(arguments[:node_id]), '_shutdown'
27
27
 
28
28
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -55,7 +55,7 @@ module Elasticsearch
55
55
  :level,
56
56
  :types ]
57
57
 
58
- method = 'GET'
58
+ method = HTTP_GET
59
59
 
60
60
  path = Utils.__pathify '_nodes',
61
61
  Utils.__listify(arguments[:node_id]),
@@ -21,10 +21,10 @@ module Elasticsearch
21
21
  #
22
22
  # @example Evaluate a custom document (passed as `:doc`) against the queries
23
23
  #
24
- # client.percolate index: 'my-index', body: { doc: { title: "Foo" } }
24
+ # client.percolate index: 'my-index', type: 'my-type', body: { doc: { title: "Foo" } }
25
25
  # # => {..., matches: [ {_index: 'my-index', _id: 'alert-1'} ]}
26
26
  #
27
- # client.percolate index: 'my-index', body: { doc: { title: "Foo Bar" } }
27
+ # client.percolate index: 'my-index', type: 'my-type', body: { doc: { title: "Foo Bar" } }
28
28
  # # => {..., matches: [ {_index: 'my-index', _id: 'alert-2'}, {_index: 'my-index', _id: 'alert-1'} ] }
29
29
  #
30
30
  # @example Evaluate an existing document against the queries
@@ -44,13 +44,12 @@ module Elasticsearch
44
44
  #
45
45
  # @example Evaluate a document against "high priority" percolator queries
46
46
  #
47
- # client.percolate index: 'my-index', body: {
47
+ # client.percolate index: 'my-index', type: 'my-type', body: {
48
48
  # doc: { title: "Foo" },
49
49
  # filter: { term: { priority: 'high' } }
50
50
  # }
51
51
  # # => {..., matches: [ {_index: 'my-index', _id: 'alert-high-1'} ]}
52
52
  #
53
- #
54
53
  # @option arguments [String] :index The index of the document being percolated. (*Required*)
55
54
  # @option arguments [String] :type The type of the document being percolated. (*Required*)
56
55
  # @option arguments [String] :id Fetch the document specified by index/type/id and
@@ -91,7 +90,7 @@ module Elasticsearch
91
90
  :version,
92
91
  :version_type ]
93
92
 
94
- method = 'GET'
93
+ method = HTTP_GET
95
94
  path = Utils.__pathify Utils.__escape(arguments[:index]),
96
95
  Utils.__escape(arguments[:type]),
97
96
  arguments[:id],
@@ -11,7 +11,7 @@ module Elasticsearch
11
11
  # @see http://elasticsearch.org/guide/
12
12
  #
13
13
  def ping(arguments={})
14
- method = 'HEAD'
14
+ method = HTTP_HEAD
15
15
  path = ""
16
16
  params = {}
17
17
  body = nil
@@ -37,7 +37,7 @@ module Elasticsearch
37
37
  :version,
38
38
  :version_type ]
39
39
 
40
- method = 'PUT'
40
+ method = HTTP_PUT
41
41
  path = "_scripts/#{arguments.delete(:lang)}/#{arguments[:id]}"
42
42
 
43
43
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -13,7 +13,7 @@ module Elasticsearch
13
13
  def put_template(arguments={})
14
14
  raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
15
15
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
16
- method = 'PUT'
16
+ method = HTTP_PUT
17
17
  path = "_search/template/#{arguments[:id]}"
18
18
  params = {}
19
19
  body = arguments[:body]
@@ -44,14 +44,14 @@ module Elasticsearch
44
44
  # @see http://www.elasticsearch.org/guide/reference/api/search/search-type/
45
45
  #
46
46
  def scroll(arguments={})
47
- method = 'GET'
47
+ method = HTTP_GET
48
48
  path = "_search/scroll"
49
49
  valid_params = [
50
50
  :scroll,
51
51
  :scroll_id ]
52
52
 
53
53
  params = Utils.__validate_and_extract_params arguments, valid_params
54
- body = arguments[:body]
54
+ body = params.delete(:scroll_id) || arguments[:body]
55
55
 
56
56
  perform_request(method, path, params, body).body
57
57
  end
@@ -112,7 +112,7 @@ module Elasticsearch
112
112
  # @see http://www.elasticsearch.org/guide/reference/api/search/request-body/
113
113
  #
114
114
  def search(arguments={})
115
- arguments[:index] = '_all' if ! arguments[:index] && arguments[:type]
115
+ arguments[:index] = UNDERSCORE_ALL if ! arguments[:index] && arguments[:type]
116
116
 
117
117
  valid_params = [
118
118
  :analyzer,
@@ -130,6 +130,7 @@ module Elasticsearch
130
130
  :lowercase_expanded_terms,
131
131
  :preference,
132
132
  :q,
133
+ :query_cache,
133
134
  :routing,
134
135
  :scroll,
135
136
  :search_type,
@@ -147,8 +148,8 @@ module Elasticsearch
147
148
  :timeout,
148
149
  :version ]
149
150
 
150
- method = 'GET'
151
- path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '_search' )
151
+ method = HTTP_GET
152
+ path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), UNDERSCORE_SEARCH )
152
153
 
153
154
  params = Utils.__validate_and_extract_params arguments, valid_params
154
155
  body = arguments[:body]
@@ -29,7 +29,7 @@ module Elasticsearch
29
29
  :ignore_unavailable,
30
30
  :allow_no_indices,
31
31
  :expand_wildcards ]
32
- method = 'GET'
32
+ method = HTTP_GET
33
33
  path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '_search_shards' )
34
34
  params = Utils.__validate_and_extract_params arguments, valid_params
35
35
  body = nil
@@ -49,7 +49,7 @@ module Elasticsearch
49
49
  :routing,
50
50
  :scroll,
51
51
  :search_type ]
52
- method = 'GET'
52
+ method = HTTP_GET
53
53
  path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '_search/template' )
54
54
  params = Utils.__validate_and_extract_params arguments, valid_params
55
55
  body = arguments[:body]
@@ -34,7 +34,7 @@ module Elasticsearch
34
34
  repository = arguments.delete(:repository)
35
35
  snapshot = arguments.delete(:snapshot)
36
36
 
37
- method = 'PUT'
37
+ method = HTTP_PUT
38
38
  path = Utils.__pathify( '_snapshot', Utils.__escape(repository), Utils.__escape(snapshot) )
39
39
 
40
40
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -30,7 +30,7 @@ module Elasticsearch
30
30
 
31
31
  repository = arguments.delete(:repository)
32
32
 
33
- method = 'PUT'
33
+ method = HTTP_PUT
34
34
  path = Utils.__pathify( '_snapshot', Utils.__escape(repository) )
35
35
 
36
36
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -27,7 +27,7 @@ module Elasticsearch
27
27
  repository = arguments.delete(:repository)
28
28
  snapshot = arguments.delete(:snapshot)
29
29
 
30
- method = 'DELETE'
30
+ method = HTTP_DELETE
31
31
  path = Utils.__pathify( '_snapshot', Utils.__escape(repository), Utils.__listify(snapshot) )
32
32
 
33
33
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -24,7 +24,7 @@ module Elasticsearch
24
24
 
25
25
  repository = arguments.delete(:repository)
26
26
 
27
- method = 'DELETE'
27
+ method = HTTP_DELETE
28
28
  path = Utils.__pathify( '_snapshot', Utils.__listify(repository) )
29
29
 
30
30
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -33,7 +33,7 @@ module Elasticsearch
33
33
  repository = arguments.delete(:repository)
34
34
  snapshot = arguments.delete(:snapshot)
35
35
 
36
- method = 'GET'
36
+ method = HTTP_GET
37
37
  path = Utils.__pathify( '_snapshot', Utils.__escape(repository), Utils.__listify(snapshot) )
38
38
 
39
39
  params = Utils.__validate_and_extract_params arguments, valid_params
@@ -28,7 +28,7 @@ module Elasticsearch
28
28
 
29
29
  repository = arguments.delete(:repository)
30
30
 
31
- method = 'GET'
31
+ method = HTTP_GET
32
32
  path = Utils.__pathify( '_snapshot', Utils.__escape(repository) )
33
33
 
34
34
  params = Utils.__validate_and_extract_params arguments, valid_params