Skip to content

Commit

Permalink
Add drush command to rebuild the tracker for dkan search (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
thierrydallacroce authored Feb 19, 2020
1 parent 21746e6 commit a8b5fad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/custom/dkan_search/drush.services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
dkan_search:commands:
class: \Drupal\dkan_search\Drush\DkanSearchCommands
tags:
- { name: drush.command }
25 changes: 25 additions & 0 deletions modules/custom/dkan_search/src/Drush/DkanSearchCommands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Drupal\dkan_search\Drush;

use Drush\Commands\DrushCommands;
use Drupal\search_api\Entity\Index;

/**
* Class DkanSearchCommands.
*
* @package Drupal\dkan_search\Drush
*/
class DkanSearchCommands extends DrushCommands {

/**
* Rebuild the search api tracker for the dkan index.
*
* @command dkan-search:rebuild-tracker
*/
public function rebuildTracker() {
$index = Index::load('dkan');
$index->rebuildTracker();
}

}

0 comments on commit a8b5fad

Please sign in to comment.