--- trunk/WebPac.pm 2003/07/15 15:07:42 112 +++ trunk/WebPac.pm 2003/09/02 13:24:33 120 @@ -26,6 +26,7 @@ my $INDEX = $cfg_global->val('webpac', 'index') || die "need index in global.conf, section webpac"; my $MAX_HITS = $cfg_global->val('webpac', 'max_hits') || 0; my $ON_PAGE =$cfg_global->val('webpac', 'on_page') || 10; +my $MIN_WILDCARD =$cfg_global->val('webpac', 'min_wildcard') || 1; Text::Iconv->raise_error(0); # Conversion errors raise exceptions @@ -109,6 +110,9 @@ $s.="$2* "; } elsif (m/(and|or|not)/i) { $s.="$_ "; + # don't add * to words with less than x chars + } elsif (length($_) <= $MIN_WILDCARD) { + $s.="$_ "; } else { $s.="$_* "; } @@ -177,7 +181,14 @@ my @result; for (my $i=0; $i<$rows; $i++) { - push @result, $swish_results[$offset+$i] if $swish_results[$offset+$i]; + my $r = $swish_results[$offset+$i]; + if ($r && $q->param('show_full')) { + push @result, $r; + } elsif ($r) { + # if not full output, skip html + delete $r->{html}; + push @result, $r; + } } return \@result; },