MTermVectors.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace Elasticsearch\Endpoints;
  3. use Elasticsearch\Common\Exceptions;
  4. /**
  5. * Class MTermVectors
  6. *
  7. * @category Elasticsearch
  8. * @package Elasticsearch\Endpoints
  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 MTermVectors extends AbstractEndpoint
  14. {
  15. /**
  16. * @param array $body
  17. *
  18. * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException
  19. * @return $this
  20. */
  21. public function setBody($body)
  22. {
  23. if (isset($body) !== true) {
  24. return $this;
  25. }
  26. $this->body = $body;
  27. return $this;
  28. }
  29. /**
  30. * @return string
  31. */
  32. public function getURI()
  33. {
  34. return $this->getOptionalURI('_mtermvectors');
  35. }
  36. /**
  37. * @return string[]
  38. */
  39. public function getParamWhitelist()
  40. {
  41. return array(
  42. 'ids',
  43. 'term_statistics',
  44. 'field_statistics',
  45. 'fields',
  46. 'offsets',
  47. 'positions',
  48. 'payloads',
  49. 'preference',
  50. 'routing',
  51. 'parent',
  52. 'realtime'
  53. );
  54. }
  55. /**
  56. * @return string
  57. */
  58. public function getMethod()
  59. {
  60. return 'POST';
  61. }
  62. }