summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Filter/Missing.php
blob: df8466a8e4c370c66d2442063968867d85ca7f97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php

namespace Elastica\Filter;

/**
 * Missing Filter
 *
 * @category Xodoa
 * @package Elastica
 * @author Maciej Wiercinski <maciej@wiercinski.net>
 * @link http://www.elasticsearch.org/guide/reference/query-dsl/missing-filter.html
 */
class Missing extends AbstractFilter
{
    /**
     * Construct missing filter
     *
     * @param string $field OPTIONAL
     */
    public function __construct($field = '')
    {
        if (strlen($field)) {
            $this->setField($field);
        }
    }

    /**
     * Set field
     *
     * @param  string                        $field
     * @return \Elastica\Filter\Missing
     */
    public function setField($field)
    {
        return $this->setParam('field', (string) $field);
    }
}