summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/search.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index ff5d0ccbe..1cf762fce 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -13,6 +13,7 @@ sub import {
hook(type => "indexhtml", id => "search", call => \&indexhtml);
hook(type => "delete", id => "search", call => \&delete);
hook(type => "cgi", id => "search", call => \&cgi);
+ hook(type => "disable", id => "search", call => \&disable);
}
sub getsetup () {
@@ -245,4 +246,10 @@ sub setupfiles () {
}
}
+sub disable () {
+ if (-d $config{wikistatedir}."/xapian") {
+ system("rm", "-rf", $config{wikistatedir}."/xapian");
+ }
+}
+
1