File tree Expand file tree Collapse file tree 6 files changed +32
-62
lines changed
elasticsearch-api/lib/elasticsearch/api/actions Expand file tree Collapse file tree 6 files changed +32
-62
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,12 @@ def simulate(arguments = {})
37
37
38
38
_id = arguments . delete ( :id )
39
39
40
- method = if arguments [ :body ]
41
- Elasticsearch ::API ::HTTP_POST
40
+ method = Elasticsearch ::API ::HTTP_POST
41
+ path = if _id
42
+ "_ingest/pipeline/#{ Utils . __listify ( _id ) } /_simulate"
42
43
else
43
- Elasticsearch :: API :: HTTP_GET
44
+ "_ingest/pipeline/_simulate"
44
45
end
45
-
46
- path = if _id
47
- "_ingest/pipeline/#{ Utils . __listify ( _id ) } /_simulate"
48
- else
49
- "_ingest/pipeline/_simulate"
50
- end
51
46
params = Utils . __validate_and_extract_params arguments , ParamsRegistry . get ( __method__ )
52
47
53
48
body = arguments [ :body ]
Original file line number Diff line number Diff line change @@ -51,19 +51,14 @@ def mget(arguments = {})
51
51
52
52
_type = arguments . delete ( :type )
53
53
54
- method = if arguments [ :body ]
55
- Elasticsearch ::API ::HTTP_POST
54
+ method = Elasticsearch ::API ::HTTP_POST
55
+ path = if _index && _type
56
+ "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_mget"
57
+ elsif _index
58
+ "#{ Utils . __listify ( _index ) } /_mget"
56
59
else
57
- Elasticsearch :: API :: HTTP_GET
60
+ "_mget"
58
61
end
59
-
60
- path = if _index && _type
61
- "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_mget"
62
- elsif _index
63
- "#{ Utils . __listify ( _index ) } /_mget"
64
- else
65
- "_mget"
66
- end
67
62
params = Utils . __validate_and_extract_params arguments , ParamsRegistry . get ( __method__ )
68
63
69
64
body = arguments [ :body ]
Original file line number Diff line number Diff line change @@ -52,19 +52,14 @@ def msearch(arguments = {})
52
52
53
53
_type = arguments . delete ( :type )
54
54
55
- method = if arguments [ :body ]
56
- Elasticsearch ::API ::HTTP_POST
55
+ method = Elasticsearch ::API ::HTTP_POST
56
+ path = if _index && _type
57
+ "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_msearch"
58
+ elsif _index
59
+ "#{ Utils . __listify ( _index ) } /_msearch"
57
60
else
58
- Elasticsearch :: API :: HTTP_GET
61
+ "_msearch"
59
62
end
60
-
61
- path = if _index && _type
62
- "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_msearch"
63
- elsif _index
64
- "#{ Utils . __listify ( _index ) } /_msearch"
65
- else
66
- "_msearch"
67
- end
68
63
params = Utils . __validate_and_extract_params arguments , ParamsRegistry . get ( __method__ )
69
64
70
65
body = arguments [ :body ]
Original file line number Diff line number Diff line change @@ -50,19 +50,14 @@ def msearch_template(arguments = {})
50
50
51
51
_type = arguments . delete ( :type )
52
52
53
- method = if arguments [ :body ]
54
- Elasticsearch ::API ::HTTP_POST
53
+ method = Elasticsearch ::API ::HTTP_POST
54
+ path = if _index && _type
55
+ "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_msearch/template"
56
+ elsif _index
57
+ "#{ Utils . __listify ( _index ) } /_msearch/template"
55
58
else
56
- Elasticsearch :: API :: HTTP_GET
59
+ "_msearch/template"
57
60
end
58
-
59
- path = if _index && _type
60
- "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_msearch/template"
61
- elsif _index
62
- "#{ Utils . __listify ( _index ) } /_msearch/template"
63
- else
64
- "_msearch/template"
65
- end
66
61
params = Utils . __validate_and_extract_params arguments , ParamsRegistry . get ( __method__ )
67
62
68
63
body = arguments [ :body ]
Original file line number Diff line number Diff line change @@ -43,17 +43,12 @@ def rank_eval(arguments = {})
43
43
44
44
_index = arguments . delete ( :index )
45
45
46
- method = if arguments [ :body ]
47
- Elasticsearch ::API ::HTTP_POST
46
+ method = Elasticsearch ::API ::HTTP_POST
47
+ path = if _index
48
+ "#{ Utils . __listify ( _index ) } /_rank_eval"
48
49
else
49
- Elasticsearch :: API :: HTTP_GET
50
+ "_rank_eval"
50
51
end
51
-
52
- path = if _index
53
- "#{ Utils . __listify ( _index ) } /_rank_eval"
54
- else
55
- "_rank_eval"
56
- end
57
52
params = Utils . __validate_and_extract_params arguments , ParamsRegistry . get ( __method__ )
58
53
59
54
body = arguments [ :body ]
Original file line number Diff line number Diff line change @@ -60,19 +60,14 @@ def search_template(arguments = {})
60
60
61
61
_type = arguments . delete ( :type )
62
62
63
- method = if arguments [ :body ]
64
- Elasticsearch ::API ::HTTP_POST
63
+ method = Elasticsearch ::API ::HTTP_POST
64
+ path = if _index && _type
65
+ "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_search/template"
66
+ elsif _index
67
+ "#{ Utils . __listify ( _index ) } /_search/template"
65
68
else
66
- Elasticsearch :: API :: HTTP_GET
69
+ "_search/template"
67
70
end
68
-
69
- path = if _index && _type
70
- "#{ Utils . __listify ( _index ) } /#{ Utils . __listify ( _type ) } /_search/template"
71
- elsif _index
72
- "#{ Utils . __listify ( _index ) } /_search/template"
73
- else
74
- "_search/template"
75
- end
76
71
params = Utils . __validate_and_extract_params arguments , ParamsRegistry . get ( __method__ )
77
72
78
73
body = arguments [ :body ]
You can’t perform that action at this time.
0 commit comments