|
34 | 34 | */
|
35 | 35 | class Client
|
36 | 36 | {
|
| 37 | + const VERSION = '6.5.1'; |
| 38 | + |
37 | 39 | /**
|
38 | 40 | * @var Transport
|
39 | 41 | */
|
@@ -155,6 +157,39 @@ public function ping($params = [])
|
155 | 157 | return true;
|
156 | 158 | }
|
157 | 159 |
|
| 160 | + /** |
| 161 | + * $params['body'] = (string) The ranking evaluation search definition, including |
| 162 | + * search requests, document ratings and ranking metric definition (Required) |
| 163 | + * ['index'] = (list) A comma-separated list of index names to search; use `_all` or |
| 164 | + * empty string to perform the operation on all indices |
| 165 | + * ['ignore_unavailable'] = (boolean) Whether specified concrete indices should be |
| 166 | + * ignored when unavailable (missing or closed) |
| 167 | + * ['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression |
| 168 | + * resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) |
| 169 | + * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, |
| 170 | + * closed or both. |
| 171 | + * |
| 172 | + * @return callable|array |
| 173 | + */ |
| 174 | + public function rankEval(array $params) |
| 175 | + { |
| 176 | + $body = $this->extractArgument($params, 'body'); |
| 177 | + $index = $this->extractArgument($params, 'index'); |
| 178 | + /** |
| 179 | + * @var callable $endpointBuilder |
| 180 | +*/ |
| 181 | + $endpointBuilder = $this->endpoints; |
| 182 | + /** |
| 183 | + * @var \Elasticsearch\Endpoints\RankEval $endpoint |
| 184 | +*/ |
| 185 | + $endpoint = $endpointBuilder('RankEval'); |
| 186 | + $endpoint->setBody($body) |
| 187 | + ->setIndex($index); |
| 188 | + $endpoint->setParams($params); |
| 189 | + |
| 190 | + return $this->performRequest($endpoint); |
| 191 | + } |
| 192 | + |
158 | 193 | /**
|
159 | 194 | * $params['id'] = (string) The document ID (Required)
|
160 | 195 | * ['index'] = (string) The name of the index (Required)
|
@@ -1011,6 +1046,27 @@ public function scroll($params = array())
|
1011 | 1046 | return $this->performRequest($endpoint);
|
1012 | 1047 | }
|
1013 | 1048 |
|
| 1049 | + /** |
| 1050 | + * $params['body'] = (string) The script to execute |
| 1051 | + * |
| 1052 | + * @return callable|array |
| 1053 | + */ |
| 1054 | + public function scriptsPainlessExecute(array $params = []) |
| 1055 | + { |
| 1056 | + $body = $this->extractArgument($params, 'body'); |
| 1057 | + /** |
| 1058 | + * @var callable $endpointBuilder |
| 1059 | +*/ |
| 1060 | + $endpointBuilder = $this->endpoints; |
| 1061 | + /** |
| 1062 | + * @var \Elasticsearch\Endpoints\ScriptsPainlessExecute $endpoint |
| 1063 | +*/ |
| 1064 | + $endpoint = $endpointBuilder('ScriptsPainlessExecute'); |
| 1065 | + $endpoint->setBody($body); |
| 1066 | + $endpoint->setParams($params); |
| 1067 | + return $this->performRequest($endpoint); |
| 1068 | + } |
| 1069 | + |
1014 | 1070 | /**
|
1015 | 1071 | * $params['scroll_id'] = (string) The scroll ID for scrolled search
|
1016 | 1072 | * ['scroll'] = (duration) Specify how long a consistent view of the index should be maintained for scrolled search
|
|
0 commit comments