Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php namespace Nord\Lumen\Elasticsearch\Search\Query\FullText; |
||
11 | class MultiMatchQuery extends MatchQuery |
||
12 | { |
||
13 | use HasFields; |
||
14 | use HasTieBreaker; |
||
15 | |||
16 | public const TYPE_BEST_FIELDS = 'best_fields'; |
||
17 | public const TYPE_MOST_FIELDS = 'most_fields'; |
||
18 | public const TYPE_CROSS_FIELDS = 'cross_fields'; |
||
19 | |||
20 | /** |
||
21 | * @inheritdoc |
||
22 | */ |
||
23 | public function toArray() |
||
24 | { |
||
25 | $multiMatch = [ |
||
26 | 'query' => $this->getValue(), |
||
27 | 'fields' => $this->getFields() |
||
28 | ]; |
||
29 | |||
30 | $multiMatch = $this->applyOptions($multiMatch); |
||
31 | |||
32 | return ['multi_match' => $multiMatch]; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param array $match |
||
37 | * @return array |
||
38 | */ |
||
39 | protected function applyOptions(array $match) |
||
49 | } |
||
50 | } |
||
51 |