| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 45 | public function run($request) |
||
| 46 | { |
||
| 47 | $service = Injector::inst()->get(ElasticCoreService::class); |
||
| 48 | $pages = SiteTree::get(); |
||
| 49 | foreach ($pages as $page) { |
||
| 50 | $q = [ |
||
| 51 | 'index' => 'search-health', |
||
| 52 | 'body' => [ |
||
| 53 | 'query' => [ |
||
| 54 | 'match' => [ |
||
| 55 | 'ObjectID' => $page->ID |
||
| 56 | ] |
||
| 57 | ] |
||
| 58 | ] |
||
| 59 | ]; |
||
| 60 | try { |
||
| 61 | $service->getClient()->deleteByQuery($q); |
||
| 62 | } catch (Exception $e) { |
||
| 63 | // noop, just continue |
||
| 68 |