| Conditions | 2 |
| Paths | 2 |
| Total Lines | 32 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types = 1); |
||
| 21 | public function search(?string $q): SearchResults |
||
| 22 | { |
||
| 23 | $result = new SearchResults(); |
||
| 24 | switch ($q) { |
||
| 25 | case 'Fish': |
||
| 26 | $records = [ |
||
| 27 | [ |
||
| 28 | 'Title' => 'Fishing in New Zealand', |
||
| 29 | ], |
||
| 30 | ]; |
||
| 31 | $recordsList = new ArrayList($records); |
||
| 32 | $result->setRecords($recordsList); |
||
| 33 | |||
| 34 | $result->setTime(0.017); |
||
| 35 | $result->setFacets([]); |
||
| 36 | |||
| 37 | $result->setPageSize(10); |
||
| 38 | $result->setPage(1); |
||
| 39 | |||
| 40 | $result->setIndex('unit_test_index'); |
||
| 41 | $result->setSuggestions(['fush']); |
||
| 42 | |||
| 43 | |||
| 44 | $highlights = ['Title' => [ |
||
| 45 | '<b>Fish</b>ing in New Zealand', |
||
| 46 | ], |
||
| 47 | ]; |
||
| 48 | |||
| 49 | $result->Highlights = $highlights; |
||
|
|
|||
| 50 | } |
||
| 51 | |||
| 52 | return $result; |
||
| 53 | } |
||
| 62 |