-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add drush command to rebuild the tracker for dkan search (#321)
- Loading branch information
1 parent
21746e6
commit a8b5fad
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
modules/custom/dkan_search/src/Drush/DkanSearchCommands.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |