Exists.php 616 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace Elastica\Query;
  3. /**
  4. * Exists query.
  5. *
  6. * @author Oleg Cherniy <oleg.cherniy@gmail.com>
  7. *
  8. * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html
  9. */
  10. class Exists extends AbstractQuery
  11. {
  12. /**
  13. * Construct exists query.
  14. *
  15. * @param string $field
  16. */
  17. public function __construct($field)
  18. {
  19. $this->setField($field);
  20. }
  21. /**
  22. * Set field.
  23. *
  24. * @param string $field
  25. *
  26. * @return $this
  27. */
  28. public function setField($field)
  29. {
  30. return $this->setParam('field', $field);
  31. }
  32. }