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    public function __construct(string $field)
18    {
19        $this->setField($field);
20    }
21
22    /**
23     * Set field.
24     *
25     * @return $this
26     */
27    public function setField(string $field): self
28    {
29        return $this->setParam('field', $field);
30    }
31}
32