# Append '*' to words if needed, ie. if it ends in a word character and is not a keyword
my @terms = map {
my $w = $_;
(/\W$/ or grep {lc($w) eq $_} qw/and or not/) ? $_ : "$_*";
(/\W$/ or $w =~ /^(koha-auth-number).*$/ or grep {lc($w) eq $_} qw/and or not/) ? $_ : "$_*";
} @words;
return join ' ', @terms;
-