FuzzyQuery::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace olvlvl\ElasticsearchDSL\Query\Term;
4
5
use olvlvl\ElasticsearchDSL\Query\Helpers\JsonSerializeAsSimpleOrExtended;
6
use olvlvl\ElasticsearchDSL\Query\Option\BoostOption;
7
use olvlvl\ElasticsearchDSL\Query\Option\FuzzyOptions;
8
use olvlvl\ElasticsearchDSL\Query\Option\HasBoostOption;
9
use olvlvl\ElasticsearchDSL\Query\Option\HasFuzzyOptions;
10
use olvlvl\ElasticsearchDSL\Query\QueryAbstract;
11
12
/**
13
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-fuzzy-query.html
14
 */
15
class FuzzyQuery extends QueryAbstract implements HasFuzzyOptions, HasBoostOption
16
{
17
	use FuzzyOptions;
18
	use BoostOption;
19
	use JsonSerializeAsSimpleOrExtended {
20
		jsonSerializeAsSimpleOrExtended as public jsonSerialize;
21
	}
22
23
	const NAME = 'fuzzy';
24
25
26
	/**
27
	 * @var string
28
	 */
29
	private $field;
30
31
	/**
32
	 * @var mixed
33
	 */
34
	private $value;
35
36
	public function __construct(string $field, $value)
37
	{
38
		$this->field = $field;
39
		$this->value = $value;
40
	}
41
}
42