aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/search.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-06-13 13:05:44 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-06-13 13:05:44 -0400
commit5807f1de04aa7d3910e7f694e0d1e5613d8f5b41 (patch)
tree5d5c8a7b5aa4e572bd5b73d512aa95463e13ca80 /IkiWiki/Plugin/search.pm
parent340f2198183cf20cc08e9ad33f377d6a8fcec35b (diff)
downloadikiwiki-5807f1de04aa7d3910e7f694e0d1e5613d8f5b41.tar
ikiwiki-5807f1de04aa7d3910e7f694e0d1e5613d8f5b41.tar.gz
fix two build bugs
* ikiwiki-mass-rebuild: Make group list comparison more robust. * search: Work around xapian bug #486138 by only stemming locales in a whitelist.
Diffstat (limited to 'IkiWiki/Plugin/search.pm')
-rw-r--r--IkiWiki/Plugin/search.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 3ac435197..8fc2f3724 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -108,8 +108,14 @@ sub index (@) { #{{{
if (! $stemmer) {
my $langcode=$ENV{LANG} || "en";
$langcode=~s/_.*//;
- eval { $stemmer=Search::Xapian::Stem->new($langcode) };
- if ($@) {
+
+ # This whitelist is here to work around a xapian bug (#486138)
+ my @whitelist=qw{da de en es fi fr hu it no pt ru ro sv tr};
+
+ if (grep { $_ eq $langcode } @whitelist) {
+ $stemmer=Search::Xapian::Stem->new($langcode);
+ }
+ else {
$stemmer=Search::Xapian::Stem->new("english");
}
}