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