IndicesNamespace.php 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197
  1. <?php
  2. namespace Elasticsearch\Namespaces;
  3. /**
  4. * Class IndicesNamespace
  5. *
  6. * @category Elasticsearch
  7. * @package Elasticsearch\Namespaces\IndicesNamespace
  8. * @author Zachary Tong <zach@elastic.co>
  9. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  10. * @link http://elastic.co
  11. */
  12. class IndicesNamespace extends AbstractNamespace
  13. {
  14. /**
  15. * $params['index'] = (list) A comma-separated list of indices to check (Required)
  16. *
  17. * @param $params array Associative array of parameters
  18. *
  19. * @return boolean
  20. */
  21. public function exists($params)
  22. {
  23. $index = $this->extractArgument($params, 'index');
  24. //manually make this verbose so we can check status code
  25. $params['client']['verbose'] = true;
  26. /** @var callback $endpointBuilder */
  27. $endpointBuilder = $this->endpoints;
  28. /** @var \Elasticsearch\Endpoints\Indices\Exists $endpoint */
  29. $endpoint = $endpointBuilder('Indices\Exists');
  30. $endpoint->setIndex($index);
  31. $endpoint->setParams($params);
  32. return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
  33. }
  34. /**
  35. * $params['index'] = (list) A comma-separated list of indices to check (Required)
  36. * ['feature'] = (list) A comma-separated list of features to return
  37. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  38. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  39. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  40. * ['local'] = (bool) Return local information, do not retrieve the state from master node (default: false)
  41. *
  42. * @param $params array Associative array of parameters
  43. *
  44. * @return bool
  45. */
  46. public function get($params)
  47. {
  48. $index = $this->extractArgument($params, 'index');
  49. $feature = $this->extractArgument($params, 'feature');
  50. /** @var callback $endpointBuilder */
  51. $endpointBuilder = $this->endpoints;
  52. /** @var \Elasticsearch\Endpoints\Indices\Get $endpoint */
  53. $endpoint = $endpointBuilder('Indices\Get');
  54. $endpoint->setIndex($index)
  55. ->setFeature($feature)
  56. ->setParams($params);
  57. return $this->performRequest($endpoint);
  58. }
  59. /**
  60. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  61. * ['operation_threading'] = () TODO: ?
  62. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  63. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  64. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  65. *
  66. * @param $params array Associative array of parameters
  67. *
  68. * @return array
  69. */
  70. public function segments($params = array())
  71. {
  72. $index = $this->extractArgument($params, 'index');
  73. /** @var callback $endpointBuilder */
  74. $endpointBuilder = $this->endpoints;
  75. /** @var \Elasticsearch\Endpoints\Indices\Segments $endpoint */
  76. $endpoint = $endpointBuilder('Indices\Segments');
  77. $endpoint->setIndex($index);
  78. $endpoint->setParams($params);
  79. return $this->performRequest($endpoint);
  80. }
  81. /**
  82. * $params['name'] = (string) The name of the template (Required)
  83. * ['timeout'] = (time) Explicit operation timeout
  84. *
  85. * @param $params array Associative array of parameters
  86. *
  87. * @return array
  88. */
  89. public function deleteTemplate($params)
  90. {
  91. $name = $this->extractArgument($params, 'name');
  92. /** @var callback $endpointBuilder */
  93. $endpointBuilder = $this->endpoints;
  94. /** @var \Elasticsearch\Endpoints\Indices\Template\Delete $endpoint */
  95. $endpoint = $endpointBuilder('Indices\Template\Delete');
  96. $endpoint->setName($name);
  97. $endpoint->setParams($params);
  98. return $this->performRequest($endpoint);
  99. }
  100. /**
  101. * $params['index'] = (list) A comma-separated list of indices to delete; use `_all` or empty string to delete all indices
  102. * ['timeout'] = (time) Explicit operation timeout
  103. *
  104. * @param $params array Associative array of parameters
  105. *
  106. * @return array
  107. */
  108. public function delete($params = array())
  109. {
  110. $index = $this->extractArgument($params, 'index');
  111. /** @var callback $endpointBuilder */
  112. $endpointBuilder = $this->endpoints;
  113. /** @var \Elasticsearch\Endpoints\Indices\Delete $endpoint */
  114. $endpoint = $endpointBuilder('Indices\Delete');
  115. $endpoint->setIndex($index);
  116. $endpoint->setParams($params);
  117. return $this->performRequest($endpoint);
  118. }
  119. /**
  120. * $params['fields'] = (boolean) A comma-separated list of fields for `fielddata` metric (supports wildcards)
  121. * ['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  122. * ['indexing_types'] = (list) A comma-separated list of document types to include in the `indexing` statistics
  123. * ['metric_family'] = (enum) Limit the information returned to a specific metric
  124. * ['search_groups'] = (list) A comma-separated list of search groups to include in the `search` statistics
  125. * ['all'] = (boolean) Return all available information
  126. * ['clear'] = (boolean) Reset the default level of detail
  127. * ['docs'] = (boolean) Return information about indexed and deleted documents
  128. * ['fielddata'] = (boolean) Return information about field data
  129. * ['filter_cache'] = (boolean) Return information about filter cache
  130. * ['flush'] = (boolean) Return information about flush operations
  131. * ['get'] = (boolean) Return information about get operations
  132. * ['groups'] = (boolean) A comma-separated list of search groups for `search` statistics
  133. * ['id_cache'] = (boolean) Return information about ID cache
  134. * ['ignore_indices'] = (enum) When performed on multiple indices, allows to ignore `missing` ones
  135. * ['indexing'] = (boolean) Return information about indexing operations
  136. * ['merge'] = (boolean) Return information about merge operations
  137. * ['refresh'] = (boolean) Return information about refresh operations
  138. * ['search'] = (boolean) Return information about search operations; use the `groups` parameter to include information for specific search groups
  139. * ['store'] = (boolean) Return information about the size of the index
  140. *
  141. * @param $params array Associative array of parameters
  142. *
  143. * @return array
  144. */
  145. public function stats($params = array())
  146. {
  147. $metric = $this->extractArgument($params, 'metric');
  148. $index = $this->extractArgument($params, 'index');
  149. /** @var callback $endpointBuilder */
  150. $endpointBuilder = $this->endpoints;
  151. /** @var \Elasticsearch\Endpoints\Indices\Stats $endpoint */
  152. $endpoint = $endpointBuilder('Indices\Stats');
  153. $endpoint->setIndex($index)
  154. ->setMetric($metric);
  155. $endpoint->setParams($params);
  156. return $this->performRequest($endpoint);
  157. }
  158. /**
  159. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  160. * ['body'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  161. *
  162. * @param $params array Associative array of parameters
  163. *
  164. * @return array
  165. */
  166. public function putSettings($params = array())
  167. {
  168. $index = $this->extractArgument($params, 'index');
  169. $body = $this->extractArgument($params, 'body');
  170. /** @var callback $endpointBuilder */
  171. $endpointBuilder = $this->endpoints;
  172. /** @var \Elasticsearch\Endpoints\Indices\Settings\Put $endpoint */
  173. $endpoint = $endpointBuilder('Indices\Settings\Put');
  174. $endpoint->setIndex($index)
  175. ->setBody($body);
  176. $endpoint->setParams($params);
  177. return $this->performRequest($endpoint);
  178. }
  179. /**
  180. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  181. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  182. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  183. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  184. *
  185. * @param $params array Associative array of parameters
  186. *
  187. * @return array
  188. */
  189. public function snapshotIndex($params = array())
  190. {
  191. $index = $this->extractArgument($params, 'index');
  192. /** @var callback $endpointBuilder */
  193. $endpointBuilder = $this->endpoints;
  194. /** @var \Elasticsearch\Endpoints\Indices\Gateway\Snapshot $endpoint */
  195. $endpoint = $endpointBuilder('Indices\Gateway\Snapshot');
  196. $endpoint->setIndex($index);
  197. $endpoint->setParams($params);
  198. return $this->performRequest($endpoint);
  199. }
  200. /**
  201. * $params['index'] = (string) The name of the source index to shrink
  202. * ['target'] = (string) The name of the target index to shrink into
  203. * ['timeout'] = (time) Explicit operation timeout
  204. * ['master_timeout'] = (time) Specify timeout for connection to master
  205. *
  206. * @param $params array Associative array of parameters
  207. *
  208. * @return array
  209. */
  210. public function shrink($params = array())
  211. {
  212. $index = $this->extractArgument($params, 'index');
  213. $target = $this->extractArgument($params, 'target');
  214. $body = $this->extractArgument($params, 'body');
  215. /** @var callback $endpointBuilder */
  216. $endpointBuilder = $this->endpoints;
  217. /** @var \Elasticsearch\Endpoints\Indices\Shrink $endpoint */
  218. $endpoint = $endpointBuilder('Indices\Shrink');
  219. $endpoint->setIndex($index)
  220. ->setTarget($target)
  221. ->setBody($body);
  222. return $this->performRequest($endpoint);
  223. }
  224. /**
  225. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  226. * ['type'] = (list) A comma-separated list of document types
  227. *
  228. * @param $params array Associative array of parameters
  229. *
  230. * @return array
  231. */
  232. public function getMapping($params = array())
  233. {
  234. $index = $this->extractArgument($params, 'index');
  235. $type = $this->extractArgument($params, 'type');
  236. /** @var callback $endpointBuilder */
  237. $endpointBuilder = $this->endpoints;
  238. /** @var \Elasticsearch\Endpoints\Indices\Mapping\Get $endpoint */
  239. $endpoint = $endpointBuilder('Indices\Mapping\Get');
  240. $endpoint->setIndex($index)
  241. ->setType($type);
  242. $endpoint->setParams($params);
  243. return $this->performRequest($endpoint);
  244. }
  245. /**
  246. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  247. * ['type'] = (list) A comma-separated list of document types
  248. * ['field'] = (list) A comma-separated list of document fields
  249. * ['include_defaults'] = (bool) specifies default mapping values should be returned
  250. *
  251. * @param $params array Associative array of parameters
  252. *
  253. * @return array
  254. */
  255. public function getFieldMapping($params = array())
  256. {
  257. $index = $this->extractArgument($params, 'index');
  258. $type = $this->extractArgument($params, 'type');
  259. $fields = $this->extractArgument($params, 'fields');
  260. if (!isset($fields)) {
  261. $fields = $this->extractArgument($params, 'field');
  262. }
  263. /** @var callback $endpointBuilder */
  264. $endpointBuilder = $this->endpoints;
  265. /** @var \Elasticsearch\Endpoints\Indices\Mapping\GetField $endpoint */
  266. $endpoint = $endpointBuilder('Indices\Mapping\GetField');
  267. $endpoint->setIndex($index)
  268. ->setType($type)
  269. ->setFields($fields);
  270. $endpoint->setParams($params);
  271. return $this->performRequest($endpoint);
  272. }
  273. /**
  274. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  275. * ['force'] = (boolean) TODO: ?
  276. * ['full'] = (boolean) TODO: ?
  277. * ['refresh'] = (boolean) Refresh the index after performing the operation
  278. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  279. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  280. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  281. *
  282. * @param $params array Associative array of parameters
  283. *
  284. * @return array
  285. */
  286. public function flush($params = array())
  287. {
  288. $index = $this->extractArgument($params, 'index');
  289. /** @var callback $endpointBuilder */
  290. $endpointBuilder = $this->endpoints;
  291. /** @var \Elasticsearch\Endpoints\Indices\Flush $endpoint */
  292. $endpoint = $endpointBuilder('Indices\Flush');
  293. $endpoint->setIndex($index);
  294. $endpoint->setParams($params);
  295. return $this->performRequest($endpoint);
  296. }
  297. /**
  298. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  299. * ['force'] = (boolean) TODO: ?
  300. * ['full'] = (boolean) TODO: ?
  301. * ['refresh'] = (boolean) Refresh the index after performing the operation
  302. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  303. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  304. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  305. *
  306. * @param $params array Associative array of parameters
  307. *
  308. * @return array
  309. */
  310. public function flushSynced($params = array())
  311. {
  312. $index = $this->extractArgument($params, 'index');
  313. /** @var callback $endpointBuilder */
  314. $endpointBuilder = $this->endpoints;
  315. /** @var \Elasticsearch\Endpoints\Indices\Flush $endpoint */
  316. $endpoint = $endpointBuilder('Indices\Flush');
  317. $endpoint->setIndex($index);
  318. $endpoint->setParams($params);
  319. $endpoint->setSynced(true);
  320. return $this->performRequest($endpoint);
  321. }
  322. /**
  323. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  324. * ['operation_threading'] = () TODO: ?
  325. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  326. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  327. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  328. *
  329. * @param $params array Associative array of parameters
  330. *
  331. * @return array
  332. */
  333. public function refresh($params = array())
  334. {
  335. $index = $this->extractArgument($params, 'index');
  336. /** @var callback $endpointBuilder */
  337. $endpointBuilder = $this->endpoints;
  338. /** @var \Elasticsearch\Endpoints\Indices\Refresh $endpoint */
  339. $endpoint = $endpointBuilder('Indices\Refresh');
  340. $endpoint->setIndex($index);
  341. $endpoint->setParams($params);
  342. return $this->performRequest($endpoint);
  343. }
  344. /**
  345. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  346. * ['detailed'] = (bool) Whether to display detailed information about shard recovery
  347. * ['active_only'] = (bool) Display only those recoveries that are currently on-going
  348. * ['human'] = (bool) Whether to return time and byte values in human-readable format.
  349. *
  350. * @param $params array Associative array of parameters
  351. *
  352. * @return array
  353. */
  354. public function recovery($params = array())
  355. {
  356. $index = $this->extractArgument($params, 'index');
  357. /** @var callback $endpointBuilder */
  358. $endpointBuilder = $this->endpoints;
  359. /** @var \Elasticsearch\Endpoints\Indices\Flush $endpoint */
  360. $endpoint = $endpointBuilder('Indices\Recovery');
  361. $endpoint->setIndex($index);
  362. $endpoint->setParams($params);
  363. return $this->performRequest($endpoint);
  364. }
  365. /**
  366. * $params['index'] = (list) A comma-separated list of index names; use `_all` to check the types across all indices (Required)
  367. * ['type'] = (list) A comma-separated list of document types to check (Required)
  368. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  369. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  370. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  371. *
  372. * @param $params array Associative array of parameters
  373. *
  374. * @return boolean
  375. */
  376. public function existsType($params)
  377. {
  378. $index = $this->extractArgument($params, 'index');
  379. $type = $this->extractArgument($params, 'type');
  380. //manually make this verbose so we can check status code
  381. $params['client']['verbose'] = true;
  382. /** @var callback $endpointBuilder */
  383. $endpointBuilder = $this->endpoints;
  384. /** @var \Elasticsearch\Endpoints\Indices\Type\Exists $endpoint */
  385. $endpoint = $endpointBuilder('Indices\Type\Exists');
  386. $endpoint->setIndex($index)
  387. ->setType($type);
  388. $endpoint->setParams($params);
  389. return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
  390. }
  391. /**
  392. * $params['index'] = (string) The name of the index with an alias
  393. * ['name'] = (string) The name of the alias to be created or updated
  394. * ['timeout'] = (time) Explicit timestamp for the document
  395. * ['body'] = (time) Explicit timestamp for the document
  396. *
  397. * @param $params array Associative array of parameters
  398. *
  399. * @return array
  400. */
  401. public function putAlias($params = array())
  402. {
  403. $index = $this->extractArgument($params, 'index');
  404. $name = $this->extractArgument($params, 'name');
  405. $body = $this->extractArgument($params, 'body');
  406. /** @var callback $endpointBuilder */
  407. $endpointBuilder = $this->endpoints;
  408. /** @var \Elasticsearch\Endpoints\Indices\Alias\Put $endpoint */
  409. $endpoint = $endpointBuilder('Indices\Alias\Put');
  410. $endpoint->setIndex($index)
  411. ->setName($name)
  412. ->setBody($body);
  413. $endpoint->setParams($params);
  414. return $this->performRequest($endpoint);
  415. }
  416. /**
  417. * $params['name'] = (string) The name of the template (Required)
  418. * ['order'] = (number) The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
  419. * ['timeout'] = (time) Explicit operation timeout
  420. * ['body'] = (time) Explicit operation timeout
  421. * ['create'] = (bool) Whether the index template should only be added if new or can also replace an existing one
  422. *
  423. * @param $params array Associative array of parameters
  424. *
  425. * @return array
  426. */
  427. public function putTemplate($params)
  428. {
  429. $name = $this->extractArgument($params, 'name');
  430. $body = $this->extractArgument($params, 'body');
  431. /** @var callback $endpointBuilder */
  432. $endpointBuilder = $this->endpoints;
  433. /** @var \Elasticsearch\Endpoints\Indices\Template\Put $endpoint */
  434. $endpoint = $endpointBuilder('Indices\Template\Put');
  435. $endpoint->setName($name)
  436. ->setBody($body);
  437. $endpoint->setParams($params);
  438. return $this->performRequest($endpoint);
  439. }
  440. /**
  441. * $params['index'] = (list) A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
  442. * ['type'] = (list) A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types
  443. * ['explain'] = (boolean) Return detailed information about the error
  444. * ['ignore_indices'] = (enum) When performed on multiple indices, allows to ignore `missing` ones
  445. * ['operation_threading'] = () TODO: ?
  446. * ['source'] = (string) The URL-encoded query definition (instead of using the request body)
  447. * ['body'] = (string) The URL-encoded query definition (instead of using the request body)
  448. *
  449. * @param $params array Associative array of parameters
  450. *
  451. * @return array
  452. */
  453. public function validateQuery($params = array())
  454. {
  455. $index = $this->extractArgument($params, 'index');
  456. $type = $this->extractArgument($params, 'type');
  457. $body = $this->extractArgument($params, 'body');
  458. /** @var callback $endpointBuilder */
  459. $endpointBuilder = $this->endpoints;
  460. /** @var \Elasticsearch\Endpoints\Indices\Validate\Query $endpoint */
  461. $endpoint = $endpointBuilder('Indices\Validate\Query');
  462. $endpoint->setIndex($index)
  463. ->setType($type)
  464. ->setBody($body);
  465. $endpoint->setParams($params);
  466. return $this->performRequest($endpoint);
  467. }
  468. /**
  469. * $params['name'] = (list) A comma-separated list of alias names to return (Required)
  470. * ['index'] = (list) A comma-separated list of index names to filter aliases
  471. * ['ignore_indices'] = (enum) When performed on multiple indices, allows to ignore `missing` ones
  472. * ['name'] = (list) A comma-separated list of alias names to return
  473. *
  474. * @param $params array Associative array of parameters
  475. *
  476. * @return array
  477. */
  478. public function getAlias($params)
  479. {
  480. $index = $this->extractArgument($params, 'index');
  481. $name = $this->extractArgument($params, 'name');
  482. /** @var callback $endpointBuilder */
  483. $endpointBuilder = $this->endpoints;
  484. /** @var \Elasticsearch\Endpoints\Indices\Alias\Get $endpoint */
  485. $endpoint = $endpointBuilder('Indices\Alias\Get');
  486. $endpoint->setIndex($index)
  487. ->setName($name);
  488. $endpoint->setParams($params);
  489. return $this->performRequest($endpoint);
  490. }
  491. /**
  492. * $params['index'] = (list) A comma-separated list of index names; use `_all` to perform the operation on all indices (Required)
  493. * ['type'] = (string) The name of the document type
  494. * ['ignore_conflicts'] = (boolean) Specify whether to ignore conflicts while updating the mapping (default: false)
  495. * ['timeout'] = (time) Explicit operation timeout
  496. * ['body'] = (time) Explicit operation timeout
  497. *
  498. * @param $params array Associative array of parameters
  499. *
  500. * @return array
  501. */
  502. public function putMapping($params)
  503. {
  504. $index = $this->extractArgument($params, 'index');
  505. $type = $this->extractArgument($params, 'type');
  506. $body = $this->extractArgument($params, 'body');
  507. /** @var callback $endpointBuilder */
  508. $endpointBuilder = $this->endpoints;
  509. /** @var \Elasticsearch\Endpoints\Indices\Mapping\Put $endpoint */
  510. $endpoint = $endpointBuilder('Indices\Mapping\Put');
  511. $endpoint->setIndex($index)
  512. ->setType($type)
  513. ->setBody($body);
  514. $endpoint->setParams($params);
  515. return $this->performRequest($endpoint);
  516. }
  517. /**
  518. * $params['index'] = (list) A comma-separated list of index names; use `_all` for all indices (Required)
  519. * ['type'] = (string) The name of the document type to delete (Required)
  520. *
  521. * @param $params array Associative array of parameters
  522. *
  523. * @return array
  524. */
  525. public function deleteMapping($params)
  526. {
  527. $index = $this->extractArgument($params, 'index');
  528. $type = $this->extractArgument($params, 'type');
  529. /** @var callback $endpointBuilder */
  530. $endpointBuilder = $this->endpoints;
  531. /** @var \Elasticsearch\Endpoints\Indices\Mapping\Delete $endpoint */
  532. $endpoint = $endpointBuilder('Indices\Mapping\Delete');
  533. $endpoint->setIndex($index)
  534. ->setType($type);
  535. $endpoint->setParams($params);
  536. return $this->performRequest($endpoint);
  537. }
  538. /**
  539. * $params['name'] = (string) The name of the template (Required)
  540. *
  541. * @param $params array Associative array of parameters
  542. *
  543. * @return array
  544. */
  545. public function getTemplate($params)
  546. {
  547. $name = $this->extractArgument($params, 'name');
  548. /** @var callback $endpointBuilder */
  549. $endpointBuilder = $this->endpoints;
  550. /** @var \Elasticsearch\Endpoints\Indices\Template\Get $endpoint */
  551. $endpoint = $endpointBuilder('Indices\Template\Get');
  552. $endpoint->setName($name);
  553. $endpoint->setParams($params);
  554. return $this->performRequest($endpoint);
  555. }
  556. /**
  557. * $params['name'] = (string) The name of the template (Required)
  558. *
  559. * @param $params array Associative array of parameters
  560. *
  561. * @return boolean
  562. */
  563. public function existsTemplate($params)
  564. {
  565. $name = $this->extractArgument($params, 'name');
  566. //manually make this verbose so we can check status code
  567. $params['client']['verbose'] = true;
  568. /** @var callback $endpointBuilder */
  569. $endpointBuilder = $this->endpoints;
  570. /** @var \Elasticsearch\Endpoints\Indices\Template\Exists $endpoint */
  571. $endpoint = $endpointBuilder('Indices\Template\Exists');
  572. $endpoint->setName($name);
  573. $endpoint->setParams($params);
  574. return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
  575. }
  576. /**
  577. * $params['index'] = (string) The name of the index (Required)
  578. * ['timeout'] = (time) Explicit operation timeout
  579. * ['body'] = (time) Explicit operation timeout
  580. *
  581. * @param $params array Associative array of parameters
  582. *
  583. * @return array
  584. */
  585. public function create($params)
  586. {
  587. $index = $this->extractArgument($params, 'index');
  588. $body = $this->extractArgument($params, 'body');
  589. /** @var callback $endpointBuilder */
  590. $endpointBuilder = $this->endpoints;
  591. /** @var \Elasticsearch\Endpoints\Indices\Create $endpoint */
  592. $endpoint = $endpointBuilder('Indices\Create');
  593. $endpoint->setIndex($index)
  594. ->setBody($body);
  595. $endpoint->setParams($params);
  596. return $this->performRequest($endpoint);
  597. }
  598. /**
  599. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  600. * ['flush'] = (boolean) Specify whether the index should be flushed after performing the operation (default: true)
  601. * ['max_num_segments'] = (number) The number of segments the index should be merged into (default: dynamic)
  602. * ['only_expunge_deletes'] = (boolean) Specify whether the operation should only expunge deleted documents
  603. * ['operation_threading'] = () TODO: ?
  604. * ['refresh'] = (boolean) Specify whether the index should be refreshed after performing the operation (default: true)
  605. * ['wait_for_merge'] = (boolean) Specify whether the request should block until the merge process is finished (default: true)
  606. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  607. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  608. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  609. *
  610. * @param $params array Associative array of parameters
  611. *
  612. * @return array
  613. */
  614. public function forceMerge($params = array())
  615. {
  616. $index = $this->extractArgument($params, 'index');
  617. /** @var callback $endpointBuilder */
  618. $endpointBuilder = $this->endpoints;
  619. /** @var \Elasticsearch\Endpoints\Indices\ForceMerge $endpoint */
  620. $endpoint = $endpointBuilder('Indices\ForceMerge');
  621. $endpoint->setIndex($index);
  622. $endpoint->setParams($params);
  623. return $this->performRequest($endpoint);
  624. }
  625. /**
  626. * $params['index'] = (string) The name of the index with an alias (Required)
  627. * ['name'] = (string) The name of the alias to be deleted (Required)
  628. * ['timeout'] = (time) Explicit timestamp for the document
  629. *
  630. * @param $params array Associative array of parameters
  631. *
  632. * @return array
  633. */
  634. public function deleteAlias($params)
  635. {
  636. $index = $this->extractArgument($params, 'index');
  637. $name = $this->extractArgument($params, 'name');
  638. /** @var callback $endpointBuilder */
  639. $endpointBuilder = $this->endpoints;
  640. /** @var \Elasticsearch\Endpoints\Indices\Alias\Delete $endpoint */
  641. $endpoint = $endpointBuilder('Indices\Alias\Delete');
  642. $endpoint->setIndex($index)
  643. ->setName($name);
  644. $endpoint->setParams($params);
  645. return $this->performRequest($endpoint);
  646. }
  647. /**
  648. * $params['index'] = (string) The name of the index (Required)
  649. * ['timeout'] = (time) Explicit operation timeout
  650. *
  651. * @param $params array Associative array of parameters
  652. *
  653. * @return array
  654. */
  655. public function open($params)
  656. {
  657. $index = $this->extractArgument($params, 'index');
  658. /** @var callback $endpointBuilder */
  659. $endpointBuilder = $this->endpoints;
  660. /** @var \Elasticsearch\Endpoints\Indices\Open $endpoint */
  661. $endpoint = $endpointBuilder('Indices\Open');
  662. $endpoint->setIndex($index);
  663. $endpoint->setParams($params);
  664. return $this->performRequest($endpoint);
  665. }
  666. /**
  667. * $params['index'] = (string) The name of the index to scope the operation
  668. * ['analyzer'] = (string) The name of the analyzer to use
  669. * ['field'] = (string) Use the analyzer configured for this field (instead of passing the analyzer name)
  670. * ['filter'] = (list) A comma-separated list of filters to use for the analysis
  671. * ['prefer_local'] = (boolean) With `true`, specify that a local shard should be used if available, with `false`, use a random shard (default: true)
  672. * ['text'] = (string) The text on which the analysis should be performed (when request body is not used)
  673. * ['tokenizer'] = (string) The name of the tokenizer to use for the analysis
  674. * ['format'] = (enum) Format of the output
  675. * ['body'] = (enum) Format of the output
  676. * ['char_filter'] = (list) A comma-separated list of character filters to use for the analysis
  677. * ['explain'] = (bool) With `true`, outputs more advanced details. (default: false)
  678. * ['attributes'] = (list) A comma-separated list of token attributes to output, this parameter works only with `explain=true`
  679. * ['format'] = (enum) Format of the output (["detailed", "text"])
  680. *
  681. * @param $params array Associative array of parameters
  682. *
  683. * @return array
  684. */
  685. public function analyze($params = array())
  686. {
  687. $index = $this->extractArgument($params, 'index');
  688. $body = $this->extractArgument($params, 'body');
  689. /** @var callback $endpointBuilder */
  690. $endpointBuilder = $this->endpoints;
  691. /** @var \Elasticsearch\Endpoints\Indices\Analyze $endpoint */
  692. $endpoint = $endpointBuilder('Indices\Analyze');
  693. $endpoint->setIndex($index)
  694. ->setBody($body);
  695. $endpoint->setParams($params);
  696. return $this->performRequest($endpoint);
  697. }
  698. /**
  699. * $params['index'] = (list) A comma-separated list of index name to limit the operation
  700. * ['field_data'] = (boolean) Clear field data
  701. * ['fielddata'] = (boolean) Clear field data
  702. * ['fields'] = (list) A comma-separated list of fields to clear when using the `field_data` parameter (default: all)
  703. * ['filter'] = (boolean) Clear filter caches
  704. * ['filter_cache'] = (boolean) Clear filter caches
  705. * ['filter_keys'] = (boolean) A comma-separated list of keys to clear when using the `filter_cache` parameter (default: all)
  706. * ['id'] = (boolean) Clear ID caches for parent/child
  707. * ['id_cache'] = (boolean) Clear ID caches for parent/child
  708. * ['recycler'] = (boolean) Clear the recycler cache
  709. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  710. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  711. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  712. *
  713. * @param $params array Associative array of parameters
  714. *
  715. * @return array
  716. */
  717. public function clearCache($params = array())
  718. {
  719. $index = $this->extractArgument($params, 'index');
  720. /** @var callback $endpointBuilder */
  721. $endpointBuilder = $this->endpoints;
  722. /** @var \Elasticsearch\Endpoints\Indices\Cache\Clear $endpoint */
  723. $endpoint = $endpointBuilder('Indices\Cache\Clear');
  724. $endpoint->setIndex($index);
  725. $endpoint->setParams($params);
  726. return $this->performRequest($endpoint);
  727. }
  728. /**
  729. * $params['index'] = (list) A comma-separated list of index names to filter aliases
  730. * ['timeout'] = (time) Explicit timestamp for the document
  731. * ['body'] = (time) Explicit timestamp for the document
  732. *
  733. * @param $params array Associative array of parameters
  734. *
  735. * @return array
  736. */
  737. public function updateAliases($params = array())
  738. {
  739. $index = $this->extractArgument($params, 'index');
  740. $body = $this->extractArgument($params, 'body');
  741. /** @var callback $endpointBuilder */
  742. $endpointBuilder = $this->endpoints;
  743. /** @var \Elasticsearch\Endpoints\Indices\Aliases\Update $endpoint */
  744. $endpoint = $endpointBuilder('Indices\Aliases\Update');
  745. $endpoint->setIndex($index)
  746. ->setBody($body);
  747. $endpoint->setParams($params);
  748. return $this->performRequest($endpoint);
  749. }
  750. /**
  751. * $params['local'] = (bool) Return local information, do not retrieve the state from master node (default: false)
  752. * ['timeout'] = (time) Explicit timestamp for the document
  753. *
  754. * @param $params array Associative array of parameters
  755. *
  756. * @return array
  757. */
  758. public function getAliases($params = array())
  759. {
  760. $index = $this->extractArgument($params, 'index');
  761. $name = $this->extractArgument($params, 'name');
  762. /** @var callback $endpointBuilder */
  763. $endpointBuilder = $this->endpoints;
  764. /** @var \Elasticsearch\Endpoints\Indices\Alias\Get $endpoint */
  765. $endpoint = $endpointBuilder('Indices\Alias\Get');
  766. $endpoint->setIndex($index)
  767. ->setName($name);
  768. $endpoint->setParams($params);
  769. return $this->performRequest($endpoint);
  770. }
  771. /**
  772. * $params['name'] = (list) A comma-separated list of alias names to return (Required)
  773. * ['index'] = (list) A comma-separated list of index names to filter aliases
  774. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  775. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  776. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  777. *
  778. * @param $params array Associative array of parameters
  779. *
  780. * @return boolean
  781. */
  782. public function existsAlias($params)
  783. {
  784. $index = $this->extractArgument($params, 'index');
  785. $name = $this->extractArgument($params, 'name');
  786. //manually make this verbose so we can check status code
  787. $params['client']['verbose'] = true;
  788. /** @var callback $endpointBuilder */
  789. $endpointBuilder = $this->endpoints;
  790. /** @var \Elasticsearch\Endpoints\Indices\Alias\Exists $endpoint */
  791. $endpoint = $endpointBuilder('Indices\Alias\Exists');
  792. $endpoint->setIndex($index)
  793. ->setName($name);
  794. $endpoint->setParams($params);
  795. return BooleanRequestWrapper::performRequest($endpoint, $this->transport);
  796. }
  797. /**
  798. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  799. * ['ignore_indices'] = (enum) When performed on multiple indices, allows to ignore `missing` ones
  800. * ['operation_threading'] = () TODO: ?
  801. * ['recovery'] = (boolean) Return information about shard recovery
  802. * ['snapshot'] = (boolean) TODO: ?
  803. *
  804. * @param $params array Associative array of parameters
  805. *
  806. * @return array
  807. */
  808. public function status($params = array())
  809. {
  810. $index = $this->extractArgument($params, 'index');
  811. /** @var callback $endpointBuilder */
  812. $endpointBuilder = $this->endpoints;
  813. /** @var \Elasticsearch\Endpoints\Indices\Status $endpoint */
  814. $endpoint = $endpointBuilder('Indices\Status');
  815. $endpoint->setIndex($index);
  816. $endpoint->setParams($params);
  817. return $this->performRequest($endpoint);
  818. }
  819. /**
  820. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  821. *
  822. * @param $params array Associative array of parameters
  823. *
  824. * @return array
  825. */
  826. public function getSettings($params = array())
  827. {
  828. $index = $this->extractArgument($params, 'index');
  829. $name = $this->extractArgument($params, 'name');
  830. /** @var callback $endpointBuilder */
  831. $endpointBuilder = $this->endpoints;
  832. /** @var \Elasticsearch\Endpoints\Indices\Settings\Get $endpoint */
  833. $endpoint = $endpointBuilder('Indices\Settings\Get');
  834. $endpoint->setIndex($index)
  835. ->setName($name);
  836. $endpoint->setParams($params);
  837. return $this->performRequest($endpoint);
  838. }
  839. /**
  840. * $params['index'] = (string) The name of the index (Required)
  841. * ['timeout'] = (time) Explicit operation timeout
  842. *
  843. * @param $params array Associative array of parameters
  844. *
  845. * @return array
  846. */
  847. public function close($params)
  848. {
  849. $index = $this->extractArgument($params, 'index');
  850. /** @var callback $endpointBuilder */
  851. $endpointBuilder = $this->endpoints;
  852. /** @var \Elasticsearch\Endpoints\Indices\Close $endpoint */
  853. $endpoint = $endpointBuilder('Indices\Close');
  854. $endpoint->setIndex($index);
  855. $endpoint->setParams($params);
  856. return $this->performRequest($endpoint);
  857. }
  858. /**
  859. * $params['index'] = (string) The name of the index
  860. *
  861. * @param $params array Associative array of parameters
  862. *
  863. * @return array
  864. */
  865. public function seal($params)
  866. {
  867. $index = $this->extractArgument($params, 'index');
  868. /** @var callback $endpointBuilder */
  869. $endpointBuilder = $this->endpoints;
  870. /** @var \Elasticsearch\Endpoints\Indices\Seal $endpoint */
  871. $endpoint = $endpointBuilder('Indices\Seal');
  872. $endpoint->setIndex($index);
  873. $endpoint->setParams($params);
  874. return $this->performRequest($endpoint);
  875. }
  876. /**
  877. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  878. * ['wait_for_completion']= (boolean) Specify whether the request should block until the all segments are upgraded (default: false)
  879. * ['only_ancient_segments'] = (boolean) If true, only ancient (an older Lucene major release) segments will be upgraded
  880. * ['refresh'] = (boolean) Refresh the index after performing the operation
  881. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  882. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  883. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  884. *
  885. * @param $params array Associative array of parameters
  886. *
  887. * @return array
  888. */
  889. public function upgrade($params = array())
  890. {
  891. $index = $this->extractArgument($params, 'index');
  892. /** @var callback $endpointBuilder */
  893. $endpointBuilder = $this->endpoints;
  894. /** @var \Elasticsearch\Endpoints\Indices\Upgrade\Post $endpoint */
  895. $endpoint = $endpointBuilder('Indices\Upgrade\Post');
  896. $endpoint->setIndex($index);
  897. $endpoint->setParams($params);
  898. return $this->performRequest($endpoint);
  899. }
  900. /**
  901. * $params['index'] = (list) A comma-separated list of index names; use `_all` or empty string for all indices
  902. * ['wait_for_completion']= (boolean) Specify whether the request should block until the all segments are upgraded (default: false)
  903. * ['only_ancient_segments'] = (boolean) If true, only ancient (an older Lucene major release) segments will be upgraded
  904. * ['refresh'] = (boolean) Refresh the index after performing the operation
  905. * ['ignore_unavailable'] = (bool) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  906. * ['allow_no_indices'] = (bool) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  907. * ['expand_wildcards'] = (enum) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  908. *
  909. * @param $params array Associative array of parameters
  910. *
  911. * @return array
  912. */
  913. public function getUpgrade($params = array())
  914. {
  915. $index = $this->extractArgument($params, 'index');
  916. /** @var callback $endpointBuilder */
  917. $endpointBuilder = $this->endpoints;
  918. /** @var \Elasticsearch\Endpoints\Indices\Upgrade\Get $endpoint */
  919. $endpoint = $endpointBuilder('Indices\Upgrade\Get');
  920. $endpoint->setIndex($index);
  921. $endpoint->setParams($params);
  922. return $this->performRequest($endpoint);
  923. }
  924. /**
  925. * $params['index'] = (string) A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices
  926. * ['status'] = (list) A comma-separated list of statuses used to filter on shards to get store information for
  927. * ['ignore_unavailable'] = (boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed)
  928. * ['allow_no_indices'] = (boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
  929. * ['expand_wildcards'] = (boolean) Whether to expand wildcard expression to concrete indices that are open, closed or both.
  930. * ['operation_threading']
  931. *
  932. * @param $params array Associative array of parameters
  933. *
  934. * @return array
  935. */
  936. public function shardStores($params)
  937. {
  938. $index = $this->extractArgument($params, 'index');
  939. /** @var callback $endpointBuilder */
  940. $endpointBuilder = $this->endpoints;
  941. /** @var \Elasticsearch\Endpoints\Indices\ShardStores $endpoint */
  942. $endpoint = $endpointBuilder('Indices\ShardStores');
  943. $endpoint->setIndex($index);
  944. $endpoint->setParams($params);
  945. return $this->performRequest($endpoint);
  946. }
  947. /**
  948. * $params['newIndex'] = (string) The name of the rollover index
  949. * ['alias'] = (string) The name of the alias to rollover
  950. * ['timeout'] = (time) Explicit operation timeout
  951. * ['master_timeout'] = (time) Specify timeout for connection to master
  952. *
  953. * @param $params array Associative array of parameters
  954. *
  955. * @return array
  956. */
  957. public function rollover($params)
  958. {
  959. $newIndex = $this->extractArgument($params, 'newIndex');
  960. $alias = $this->extractArgument($params, 'alias');
  961. $body = $this->extractArgument($params, 'body');
  962. /** @var callback $endpointBuilder */
  963. $endpointBuilder = $this->endpoints;
  964. /** @var \Elasticsearch\Endpoints\Indices\Rollover $endpoint */
  965. $endpoint = $endpointBuilder('Indices\Rollover');
  966. $endpoint->setNewIndex($newIndex)
  967. ->setAlias($alias)
  968. ->setParams($params)
  969. ->setBody($body);
  970. return $this->performRequest($endpoint);
  971. }
  972. /**
  973. * $params['index'] = (string) The name of the source index to split
  974. * ['target'] = (string) The name of the target index to split into
  975. * ['copy_settings'] = (boolean) whether or not to copy settings from the source index (defaults to false)
  976. * ['timeout'] = (time) Explicit operation timeout
  977. * ['master_timeout'] = (time) Specify timeout for connection to master
  978. * ['wait_for_active_shards'] = (string) Set the number of active shards to wait for on the shrunken index before the operation returns.
  979. *
  980. * @param array $params Associative array of parameters
  981. *
  982. * @return array
  983. * @throws \Exception
  984. */
  985. public function split($params = array())
  986. {
  987. $index = $this->extractArgument($params, 'index');
  988. $body = $this->extractArgument($params, 'body');
  989. $target = $this->extractArgument($params, 'target');
  990. /** @var callback $endpointBuilder */
  991. $endpointBuilder = $this->endpoints;
  992. /** @var \Elasticsearch\Endpoints\Indices\Split $endpoint */
  993. $endpoint = $endpointBuilder('Indices\Split');
  994. $endpoint->setIndex($index)
  995. ->setBody($body)
  996. ->setTarget($target);
  997. $endpoint->setParams($params);
  998. return $this->performRequest($endpoint);
  999. }
  1000. }