PrefixQuery   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 23
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
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\HasBoostOption;
8
use olvlvl\ElasticsearchDSL\Query\QueryAbstract;
9
10
/**
11
 * @see https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-prefix-query.html
12
 */
13
class PrefixQuery extends QueryAbstract implements HasBoostOption
14
{
15
	use BoostOption;
16
	use JsonSerializeAsSimpleOrExtended {
17
		jsonSerializeAsSimpleOrExtended as public jsonSerialize;
18
	}
19
20
	const NAME = 'prefix';
21
22
	/**
23
	 * @var string
24
	 */
25
	private $field;
26
27
	/**
28
	 * @var mixed
29
	 */
30
	private $value;
31
32
	public function __construct(string $field, $value)
33
	{
34
		$this->field = $field;
35
		$this->value = $value;
36
	}
37
}
38