| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class BoostingQuery extends QueryAbstract |
||
| 13 | { |
||
| 14 | const NAME = 'boosting'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var QueryCollection |
||
| 18 | */ |
||
| 19 | private $positive; |
||
| 20 | |||
| 21 | protected function get_positive(): QueryCollection |
||
| 22 | { |
||
| 23 | return $this->positive ?: $this->positive = new QueryCollection; |
||
|
|
|||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var QueryCollection |
||
| 28 | */ |
||
| 29 | private $negative; |
||
| 30 | |||
| 31 | protected function get_negative(): QueryCollection |
||
| 32 | { |
||
| 33 | return $this->negative ?: $this->negative = new QueryCollection; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var float |
||
| 38 | */ |
||
| 39 | private $negative_boost; |
||
| 40 | |||
| 41 | public function __construct(float $negative_boost = 0.5) |
||
| 46 | } |
||
| 47 | |||
| 48 | public function jsonSerialize() |
||
| 59 |