Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php namespace Nord\Lumen\Elasticsearch\Search\Query\TermLevel; |
||
22 | public function toArray() |
||
23 | { |
||
24 | $term = ['value' => $this->getValue()]; |
||
25 | |||
26 | $boost = $this->getBoost(); |
||
27 | if (!is_null($boost)) { |
||
28 | $term['boost'] = $boost; |
||
29 | } |
||
30 | |||
31 | if (count($term) === 1 && isset($term['value'])) { |
||
32 | $term = $term['value']; |
||
33 | } |
||
34 | |||
35 | return ['term' => [$this->getField() => $term]]; |
||
36 | } |
||
58 |