Missing.php 804 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Elastica\Aggregation;
  3. /**
  4. * Class Missing.
  5. *
  6. * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-missing-aggregation.html
  7. */
  8. class Missing extends AbstractAggregation
  9. {
  10. /**
  11. * @param string $name the name of this aggregation
  12. * @param string $field the field on which to perform this aggregation
  13. */
  14. public function __construct($name, $field)
  15. {
  16. parent::__construct($name);
  17. $this->setField($field);
  18. }
  19. /**
  20. * Set the field for this aggregation.
  21. *
  22. * @param string $field the name of the document field on which to perform this aggregation
  23. *
  24. * @return $this
  25. */
  26. public function setField($field)
  27. {
  28. return $this->setParam('field', $field);
  29. }
  30. }