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.
- checksums.yaml +4 -4
- data/README.md +16 -0
- data/Rakefile +3 -3
- data/elasticsearch-api.gemspec +4 -1
- data/lib/elasticsearch/api.rb +19 -0
- data/lib/elasticsearch/api/actions/abort_benchmark.rb +1 -1
- data/lib/elasticsearch/api/actions/benchmark.rb +1 -1
- data/lib/elasticsearch/api/actions/bulk.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/aliases.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/allocation.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/count.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/fielddata.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/health.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/help.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/indices.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/master.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/nodes.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/pending_tasks.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/recovery.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/segments.rb +34 -0
- data/lib/elasticsearch/api/actions/cat/shards.rb +1 -1
- data/lib/elasticsearch/api/actions/cat/thread_pool.rb +1 -1
- data/lib/elasticsearch/api/actions/clear_scroll.rb +12 -3
- data/lib/elasticsearch/api/actions/cluster/get_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/health.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/put_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/reroute.rb +1 -1
- data/lib/elasticsearch/api/actions/cluster/state.rb +8 -2
- data/lib/elasticsearch/api/actions/count.rb +1 -1
- data/lib/elasticsearch/api/actions/count_percolate.rb +1 -1
- data/lib/elasticsearch/api/actions/delete.rb +1 -1
- data/lib/elasticsearch/api/actions/delete_by_query.rb +1 -1
- data/lib/elasticsearch/api/actions/delete_script.rb +1 -1
- data/lib/elasticsearch/api/actions/delete_template.rb +1 -1
- data/lib/elasticsearch/api/actions/exists.rb +4 -2
- data/lib/elasticsearch/api/actions/explain.rb +1 -1
- data/lib/elasticsearch/api/actions/get.rb +2 -2
- data/lib/elasticsearch/api/actions/get_script.rb +1 -1
- data/lib/elasticsearch/api/actions/get_source.rb +2 -2
- data/lib/elasticsearch/api/actions/get_template.rb +1 -1
- data/lib/elasticsearch/api/actions/index.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/analyze.rb +5 -3
- data/lib/elasticsearch/api/actions/indices/clear_cache.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/close.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/create.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/delete.rb +7 -1
- data/lib/elasticsearch/api/actions/indices/delete_alias.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/delete_mapping.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/delete_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/delete_warmer.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/exists.rb +3 -1
- data/lib/elasticsearch/api/actions/indices/exists_alias.rb +3 -1
- data/lib/elasticsearch/api/actions/indices/exists_template.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/exists_type.rb +3 -1
- data/lib/elasticsearch/api/actions/indices/flush.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_alias.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_aliases.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_mapping.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/get_template.rb +3 -2
- data/lib/elasticsearch/api/actions/indices/get_warmer.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/open.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/optimize.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_alias.rb +2 -2
- data/lib/elasticsearch/api/actions/indices/put_mapping.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_settings.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_template.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/put_warmer.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/recovery.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/refresh.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/segments.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/snapshot_index.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/stats.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/status.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/update_aliases.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/upgrade.rb +1 -1
- data/lib/elasticsearch/api/actions/indices/validate_query.rb +1 -1
- data/lib/elasticsearch/api/actions/info.rb +1 -1
- data/lib/elasticsearch/api/actions/list_benchmarks.rb +1 -1
- data/lib/elasticsearch/api/actions/mget.rb +1 -1
- data/lib/elasticsearch/api/actions/mlt.rb +1 -1
- data/lib/elasticsearch/api/actions/mpercolate.rb +1 -1
- data/lib/elasticsearch/api/actions/msearch.rb +1 -1
- data/lib/elasticsearch/api/actions/mtermvectors.rb +1 -1
- data/lib/elasticsearch/api/actions/nodes/hot_threads.rb +1 -1
- data/lib/elasticsearch/api/actions/nodes/info.rb +18 -2
- data/lib/elasticsearch/api/actions/nodes/shutdown.rb +1 -1
- data/lib/elasticsearch/api/actions/nodes/stats.rb +1 -1
- data/lib/elasticsearch/api/actions/percolate.rb +4 -5
- data/lib/elasticsearch/api/actions/ping.rb +1 -1
- data/lib/elasticsearch/api/actions/put_script.rb +1 -1
- data/lib/elasticsearch/api/actions/put_template.rb +1 -1
- data/lib/elasticsearch/api/actions/scroll.rb +2 -2
- data/lib/elasticsearch/api/actions/search.rb +4 -3
- data/lib/elasticsearch/api/actions/search_shards.rb +1 -1
- data/lib/elasticsearch/api/actions/search_template.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/create.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/create_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/delete.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/get.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/get_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/restore.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/status.rb +1 -1
- data/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +1 -1
- data/lib/elasticsearch/api/actions/suggest.rb +1 -1
- data/lib/elasticsearch/api/actions/{termvector.rb → termvectors.rb} +24 -7
- data/lib/elasticsearch/api/actions/update.rb +1 -1
- data/lib/elasticsearch/api/utils.rb +27 -6
- data/lib/elasticsearch/api/version.rb +1 -1
- data/test/integration/yaml_test_runner.rb +3 -2
- data/test/unit/api_test.rb +24 -0
- data/test/unit/cat/segments_test.rb +26 -0
- data/test/unit/clear_scroll_test.rb +4 -4
- data/test/unit/exists_document_test.rb +5 -0
- data/test/unit/indices/delete_test.rb +7 -0
- data/test/unit/indices/exists_alias_test.rb +5 -0
- data/test/unit/indices/exists_test.rb +5 -0
- data/test/unit/indices/exists_type_test.rb +5 -0
- data/test/unit/indices/put_alias_test.rb +9 -0
- data/test/unit/nodes/info_test.rb +9 -0
- data/test/unit/scroll_test.rb +1 -2
- data/test/unit/{termvector_test.rb → termvectors_test.rb} +15 -12
- data/test/unit/utils_test.rb +22 -0
- data/utils/Gemfile +9 -0
- data/utils/Thorfile +3 -0
- data/utils/thor/generate_api.rb +189 -0
- data/utils/thor/generate_source.rb +122 -0
- data/utils/thor/lister.rb +41 -0
- data/utils/thor/templates/ruby/method.erb +62 -0
- data/utils/thor/templates/ruby/test.erb +26 -0
- data/utils/thor/templates/ruby/test_helper.rb +71 -0
- metadata +18 -5
@@ -9,7 +9,7 @@ module Elasticsearch
|
|
9
9
|
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
|
10
10
|
#
|
11
11
|
def delete_template(arguments={})
|
12
|
-
method =
|
12
|
+
method = HTTP_DELETE
|
13
13
|
path = "_search/template/#{arguments[:id]}"
|
14
14
|
params = {}
|
15
15
|
body = nil
|
@@ -23,7 +23,7 @@ module Elasticsearch
|
|
23
23
|
def exists(arguments={})
|
24
24
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
25
25
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
26
|
-
arguments[:type] ||=
|
26
|
+
arguments[:type] ||= UNDERSCORE_ALL
|
27
27
|
|
28
28
|
valid_params = [
|
29
29
|
:parent,
|
@@ -32,7 +32,7 @@ module Elasticsearch
|
|
32
32
|
:refresh,
|
33
33
|
:routing ]
|
34
34
|
|
35
|
-
method =
|
35
|
+
method = HTTP_HEAD
|
36
36
|
path = Utils.__pathify Utils.__escape(arguments[:index]),
|
37
37
|
Utils.__escape(arguments[:type]),
|
38
38
|
Utils.__escape(arguments[:id])
|
@@ -48,6 +48,8 @@ module Elasticsearch
|
|
48
48
|
raise e
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
52
|
+
alias_method :exists?, :exists
|
51
53
|
end
|
52
54
|
end
|
53
55
|
end
|
@@ -34,7 +34,7 @@ module Elasticsearch
|
|
34
34
|
def get(arguments={})
|
35
35
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
36
36
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
37
|
-
arguments[:type] ||=
|
37
|
+
arguments[:type] ||= UNDERSCORE_ALL
|
38
38
|
|
39
39
|
valid_params = [
|
40
40
|
:fields,
|
@@ -49,7 +49,7 @@ module Elasticsearch
|
|
49
49
|
:_source_include,
|
50
50
|
:_source_exclude ]
|
51
51
|
|
52
|
-
method =
|
52
|
+
method = HTTP_GET
|
53
53
|
path = Utils.__pathify Utils.__escape(arguments[:index]),
|
54
54
|
Utils.__escape(arguments[:type]),
|
55
55
|
Utils.__escape(arguments[:id])
|
@@ -12,7 +12,7 @@ module Elasticsearch
|
|
12
12
|
def get_script(arguments={})
|
13
13
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
14
14
|
raise ArgumentError, "Required argument 'lang' missing" unless arguments[:lang]
|
15
|
-
method =
|
15
|
+
method = HTTP_GET
|
16
16
|
path = "_scripts/#{arguments[:lang]}/#{arguments[:id]}"
|
17
17
|
params = {}
|
18
18
|
body = nil
|
@@ -34,7 +34,7 @@ module Elasticsearch
|
|
34
34
|
def get_source(arguments={})
|
35
35
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
36
36
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
37
|
-
arguments[:type] ||=
|
37
|
+
arguments[:type] ||= UNDERSCORE_ALL
|
38
38
|
|
39
39
|
valid_params = [
|
40
40
|
:fields,
|
@@ -47,7 +47,7 @@ module Elasticsearch
|
|
47
47
|
:_source_include,
|
48
48
|
:_source_exclude ]
|
49
49
|
|
50
|
-
method =
|
50
|
+
method = HTTP_GET
|
51
51
|
path = Utils.__pathify Utils.__escape(arguments[:index]),
|
52
52
|
Utils.__escape(arguments[:type]),
|
53
53
|
Utils.__escape(arguments[:id]),
|
@@ -11,7 +11,7 @@ module Elasticsearch
|
|
11
11
|
#
|
12
12
|
def get_template(arguments={})
|
13
13
|
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
|
14
|
-
method =
|
14
|
+
method = HTTP_GET
|
15
15
|
path = "_search/template/#{arguments[:id]}"
|
16
16
|
params = {}
|
17
17
|
body = arguments[:body]
|
@@ -88,7 +88,7 @@ module Elasticsearch
|
|
88
88
|
:version,
|
89
89
|
:version_type ]
|
90
90
|
|
91
|
-
method = arguments[:id] ?
|
91
|
+
method = arguments[:id] ? HTTP_PUT : HTTP_POST
|
92
92
|
path = Utils.__pathify Utils.__escape(arguments[:index]),
|
93
93
|
Utils.__escape(arguments[:type]),
|
94
94
|
Utils.__escape(arguments[:id])
|
@@ -15,12 +15,14 @@ module Elasticsearch
|
|
15
15
|
#
|
16
16
|
# @example Analyze text "Quick Brown Jumping Fox" with a custom tokenizer and filter chain
|
17
17
|
#
|
18
|
-
# client.indices.analyze
|
18
|
+
# client.indices.analyze body: 'The Quick Brown Jumping Fox',
|
19
19
|
# tokenizer: 'whitespace',
|
20
20
|
# filters: ['lowercase','stop']
|
21
21
|
#
|
22
|
+
# @note If your text for analysis is longer than 4096 bytes then you should use the :body argument, rather than :text, to avoid HTTP transport errors
|
23
|
+
#
|
22
24
|
# @option arguments [String] :index The name of the index to scope the operation
|
23
|
-
# @option arguments [
|
25
|
+
# @option arguments [String] :body The text on which the analysis should be performed
|
24
26
|
# @option arguments [String] :analyzer The name of the analyzer to use
|
25
27
|
# @option arguments [String] :field Use the analyzer configured for this field
|
26
28
|
# (instead of passing the analyzer name)
|
@@ -46,7 +48,7 @@ module Elasticsearch
|
|
46
48
|
:tokenizer,
|
47
49
|
:format ]
|
48
50
|
|
49
|
-
method =
|
51
|
+
method = HTTP_GET
|
50
52
|
path = Utils.__pathify Utils.__listify(arguments[:index]), '_analyze'
|
51
53
|
|
52
54
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -68,7 +68,7 @@ module Elasticsearch
|
|
68
68
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
69
69
|
valid_params = [ :timeout ]
|
70
70
|
|
71
|
-
method =
|
71
|
+
method = HTTP_PUT
|
72
72
|
path = Utils.__pathify Utils.__escape(arguments[:index])
|
73
73
|
|
74
74
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -32,13 +32,19 @@ module Elasticsearch
|
|
32
32
|
def delete(arguments={})
|
33
33
|
valid_params = [ :timeout ]
|
34
34
|
|
35
|
-
method =
|
35
|
+
method = HTTP_DELETE
|
36
36
|
path = Utils.__pathify Utils.__listify(arguments[:index])
|
37
37
|
|
38
38
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
39
39
|
body = nil
|
40
40
|
|
41
41
|
perform_request(method, path, params, body).body
|
42
|
+
|
43
|
+
rescue Exception => e
|
44
|
+
# NOTE: Use exception name, not full class in Elasticsearch::Client to allow client plugability
|
45
|
+
if Array(arguments[:ignore]).include?(404) && e.class.to_s =~ /NotFound/; false
|
46
|
+
else raise(e)
|
47
|
+
end
|
42
48
|
end
|
43
49
|
end
|
44
50
|
end
|
@@ -22,7 +22,7 @@ module Elasticsearch
|
|
22
22
|
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
23
23
|
valid_params = [ :timeout ]
|
24
24
|
|
25
|
-
method =
|
25
|
+
method = HTTP_DELETE
|
26
26
|
path = Utils.__pathify Utils.__escape(arguments[:index]), '_alias', Utils.__escape(arguments[:name])
|
27
27
|
|
28
28
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -13,7 +13,7 @@ module Elasticsearch
|
|
13
13
|
def delete_mapping(arguments={})
|
14
14
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
15
15
|
raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
|
16
|
-
method =
|
16
|
+
method = HTTP_DELETE
|
17
17
|
path = Utils.__pathify Utils.__listify(arguments[:index]), Utils.__escape(arguments[:type])
|
18
18
|
params = {}
|
19
19
|
body = nil
|
@@ -22,7 +22,7 @@ module Elasticsearch
|
|
22
22
|
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
23
23
|
valid_params = [ :timeout ]
|
24
24
|
|
25
|
-
method =
|
25
|
+
method = HTTP_DELETE
|
26
26
|
path = Utils.__pathify '_template', Utils.__escape(arguments[:name])
|
27
27
|
|
28
28
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -19,7 +19,7 @@ module Elasticsearch
|
|
19
19
|
#
|
20
20
|
def delete_warmer(arguments={})
|
21
21
|
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
|
22
|
-
method =
|
22
|
+
method = HTTP_DELETE
|
23
23
|
path = Utils.__pathify Utils.__listify(arguments[:index]), '_warmer', Utils.__listify(arguments[:name])
|
24
24
|
params = {}
|
25
25
|
body = nil
|
@@ -37,7 +37,7 @@ module Elasticsearch
|
|
37
37
|
:local
|
38
38
|
]
|
39
39
|
|
40
|
-
method =
|
40
|
+
method = HTTP_HEAD
|
41
41
|
path = Utils.__listify(arguments[:index])
|
42
42
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
43
43
|
body = nil
|
@@ -50,6 +50,8 @@ module Elasticsearch
|
|
50
50
|
raise e
|
51
51
|
end
|
52
52
|
end
|
53
|
+
|
54
|
+
alias_method :exists?, :exists
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
@@ -34,7 +34,7 @@ module Elasticsearch
|
|
34
34
|
:local
|
35
35
|
]
|
36
36
|
|
37
|
-
method =
|
37
|
+
method = HTTP_HEAD
|
38
38
|
path = Utils.__pathify Utils.__listify(arguments[:index]), '_alias', Utils.__escape(arguments[:name])
|
39
39
|
|
40
40
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -48,6 +48,8 @@ module Elasticsearch
|
|
48
48
|
raise e
|
49
49
|
end
|
50
50
|
end
|
51
|
+
|
52
|
+
alias_method :exists_alias?, :exists_alias
|
51
53
|
end
|
52
54
|
end
|
53
55
|
end
|
@@ -7,14 +7,15 @@ module Elasticsearch
|
|
7
7
|
#
|
8
8
|
# @option arguments [String] :name The name of the template (*Required*)
|
9
9
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
|
10
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
10
11
|
#
|
11
12
|
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-templates.html
|
12
13
|
#
|
13
14
|
def exists_template(arguments={})
|
14
15
|
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
15
|
-
valid_params = [ :local ]
|
16
|
+
valid_params = [ :local, :master_timeout ]
|
16
17
|
|
17
|
-
method =
|
18
|
+
method = HTTP_HEAD
|
18
19
|
path = Utils.__pathify '_template', Utils.__escape(arguments[:name])
|
19
20
|
|
20
21
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -33,7 +33,7 @@ module Elasticsearch
|
|
33
33
|
:local
|
34
34
|
]
|
35
35
|
|
36
|
-
method =
|
36
|
+
method = HTTP_HEAD
|
37
37
|
path = Utils.__pathify Utils.__listify(arguments[:index]), Utils.__escape(arguments[:type])
|
38
38
|
|
39
39
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -47,6 +47,8 @@ module Elasticsearch
|
|
47
47
|
raise e
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
alias_method :exists_type?, :exists_type
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -20,7 +20,7 @@ module Elasticsearch
|
|
20
20
|
def get_aliases(arguments={})
|
21
21
|
valid_params = [ :timeout, :local ]
|
22
22
|
|
23
|
-
method =
|
23
|
+
method = HTTP_GET
|
24
24
|
path = Utils.__pathify Utils.__listify(arguments[:index]), '_aliases', Utils.__listify(arguments[:name])
|
25
25
|
|
26
26
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -19,13 +19,14 @@ module Elasticsearch
|
|
19
19
|
# @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
|
20
20
|
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
|
21
21
|
# (default: false)
|
22
|
+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
|
22
23
|
#
|
23
24
|
# @see http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/
|
24
25
|
#
|
25
26
|
def get_template(arguments={})
|
26
|
-
valid_params = [ :flat_settings, :local ]
|
27
|
+
valid_params = [ :flat_settings, :local, :master_timeout ]
|
27
28
|
|
28
|
-
method =
|
29
|
+
method = HTTP_GET
|
29
30
|
path = Utils.__pathify '_template', Utils.__escape(arguments[:name])
|
30
31
|
|
31
32
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
@@ -27,8 +27,8 @@ module Elasticsearch
|
|
27
27
|
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
|
28
28
|
valid_params = [ :timeout ]
|
29
29
|
|
30
|
-
method =
|
31
|
-
path = Utils.__pathify Utils.
|
30
|
+
method = HTTP_PUT
|
31
|
+
path = Utils.__pathify Utils.__listify(arguments[:index]), '_alias', Utils.__escape(arguments[:name])
|
32
32
|
|
33
33
|
params = Utils.__validate_and_extract_params arguments, valid_params
|
34
34
|
body = arguments[:body]
|
@@ -59,7 +59,7 @@ module Elasticsearch
|
|
59
59
|
:timeout
|
60
60
|
]
|
61
61
|
|
62
|
-
method =
|
62
|
+
method = HTTP_PUT
|
63
63
|
path = Utils.__pathify Utils.__listify(arguments[:index]), '_mapping', Utils.__escape(arguments[:type])
|
64
64
|
|
65
65
|
params = Utils.__validate_and_extract_params arguments, valid_params
|