Fielddata.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. namespace Elasticsearch\Endpoints\Cat;
  3. use Elasticsearch\Endpoints\AbstractEndpoint;
  4. /**
  5. * Class Fielddata
  6. *
  7. * @category Elasticsearch
  8. * @package Elasticsearch\Endpoints\Cat
  9. * @author Zachary Tong <zach@elastic.co>
  10. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache2
  11. * @link http://elastic.co
  12. */
  13. class Fielddata extends AbstractEndpoint
  14. {
  15. private $fields;
  16. /**
  17. * @param $fields
  18. *
  19. * @return $this
  20. */
  21. public function setFields($fields)
  22. {
  23. if (isset($fields) !== true) {
  24. return $this;
  25. }
  26. $this->fields = $fields;
  27. return $this;
  28. }
  29. /**
  30. * @return string
  31. */
  32. public function getURI()
  33. {
  34. $fields = $this->fields;
  35. $uri = "/_cat/fielddata";
  36. if (isset($fields) === true) {
  37. $uri = "/_cat/fielddata/$fields";
  38. }
  39. return $uri;
  40. }
  41. /**
  42. * @return string[]
  43. */
  44. public function getParamWhitelist()
  45. {
  46. return array(
  47. 'local',
  48. 'master_timeout',
  49. 'h',
  50. 'help',
  51. 'v',
  52. 's',
  53. 'format',
  54. );
  55. }
  56. /**
  57. * @return string
  58. */
  59. public function getMethod()
  60. {
  61. return 'GET';
  62. }
  63. }