Completed
Push — develop ( f07ae4...5325d9 )
by Sam
05:38 queued 03:06
created

AbstractQuery::setField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php namespace Nord\Lumen\Elasticsearch\Search\Query\TermLevel;
2
3
use Nord\Lumen\Elasticsearch\Search\Query\QueryDSL;
4
5
/**
6
 * While the full text queries will analyze the query string before executing, the term-level queries operate on the
7
 * exact terms that are stored in the inverted index.
8
 *
9
 * These queries are usually used for structured data like numbers, dates, and enums, rather than full text fields.
10
 * Alternatively, they allow you to craft low-level queries, foregoing the analysis process.
11
 *
12
 * The queries in this group are:
13
 *
14
 * - "term" query
15
 * Find documents which contain the exact term specified in the field specified.
16
 *
17
 * - "terms" query
18
 * Find documents which contain any of the exact terms specified in the field specified.
19
 *
20
 * - "range" query
21
 * Find documents where the field specified contains values (dates, numbers, or strings) in the range specified.
22
 *
23
 * - "exists" query
24
 * Find documents where the field specified contains any non-null value.
25
 *
26
 * - "missing" query
27
 * Find documents where the field specified does is missing or contains only null values.
28
 *
29
 * - "prefix" query
30
 * Find documents where the field specified contains terms which being with the exact prefix specified.
31
 *
32
 * - "wildcard" query
33
 * Find documents where the field specified contains terms which match the pattern specified, where the pattern supports
34
 * single character wildcards (?) and multi-character wildcards (*)
35
 *
36
 * - "regexp" query
37
 * Find documents where the field specified contains terms which match the regular expression specified.
38
 *
39
 * - "fuzzy" query
40
 * Find documents where the field specified contains terms which are fuzzily similar to the specified term.
41
 * Fuzziness is measured as a Levenshtein edit distance of 1 or 2.
42
 *
43
 * - "type" query
44
 * Find documents of the specified type.
45
 *
46
 * - "ids" query
47
 * Find documents with the specified type and IDs.
48
 *
49
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/term-level-queries.html
50
 */
51
abstract class AbstractQuery extends QueryDSL
52
{
53
54
    /**
55
     * @var string
56
     */
57
    protected $field;
58
59
    /**
60
     * @return string
61
     */
62
    public function getField()
63
    {
64
        return $this->field;
65
    }
66
67
    /**
68
     * @param string $field
69
     *
70
     * @return $this
71
     */
72
    public function setField($field)
73
    {
74
        $this->field = $field;
75
76
        return $this;
77
    }
78
}
79