| 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; |
||
| 32 | public function toArray() |
||
| 33 | { |
||
| 34 | $term = ['value' => $this->getValue()]; |
||
| 35 | |||
| 36 | $boost = $this->getBoost(); |
||
| 37 | if (!is_null($boost)) { |
||
|
|
|||
| 38 | $term['boost'] = $boost; |
||
| 39 | } |
||
| 40 | |||
| 41 | if (count($term) === 1 && isset($term['value'])) { |
||
| 42 | $term = $term['value']; |
||
| 43 | } |
||
| 44 | |||
| 45 | return ['term' => [$this->getField() => $term]]; |
||
| 46 | } |
||
| 48 |