| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function apply(QueryBuilderInterface $queryBuilder) |
||
| 15 | { |
||
| 16 | $body = $queryBuilder->getBody(); |
||
| 17 | |||
| 18 | $body['aggs']['premium_listing'] = [ |
||
| 19 | 'terms' => [ |
||
| 20 | 'field' => 'is_on_top', |
||
| 21 | 'size' => 3, |
||
| 22 | 'order' => [ |
||
| 23 | 'top_hit' => 'desc' |
||
| 24 | ] |
||
| 25 | ], |
||
| 26 | 'aggs' => [ |
||
| 27 | 'premium_listing' => [ |
||
| 28 | 'top_hits' => (object) [] |
||
| 29 | ], |
||
| 30 | 'top_hit' => [ |
||
| 31 | 'max' => [ |
||
| 32 | 'script' => ['inline' => '_score'] |
||
| 33 | ] |
||
| 34 | ] |
||
| 35 | ] |
||
| 36 | ]; |
||
| 37 | |||
| 38 | return $body; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |