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; |
||
23 | public function toArray() |
||
24 | { |
||
25 | $term = ['value' => $this->getValue()]; |
||
26 | |||
27 | $boost = $this->getBoost(); |
||
28 | if (!is_null($boost)) { |
||
29 | $term['boost'] = $boost; |
||
30 | } |
||
31 | |||
32 | if (count($term) === 1 && isset($term['value'])) { |
||
33 | $term = $term['value']; |
||
34 | } |
||
35 | |||
36 | return ['term' => [$this->getField() => $term]]; |
||
37 | } |
||
59 |