my @persist_vars = ( 'rm' );
my @url_params = ( 'rm=results', 'show_full=1', 'last_PAGER_offset='.$q->param('PAGER_offset') || 0 );
- for(my $i = 1; $i <=30; $i++) {
+ # support parametars "f" and "v" for start
+ for(my $i = ""; $i <=30; $i++) {
return show_index($self, $i) if ($q->param("f".$i."_index"));
push @url_params,"f$i=".$q->url_param("f$i");
push @url_params,"v$i=".$q->url_param("v$i");
+ my $wc="*"; # swish wildcard
+ $wc="" if ($i eq ""); # don't apply wildcard on field 0
+
# re-write query from +/- to and/and not
my @param_vals = $q->param("v$i");
my @swish_q;
if (m/^([+-])(\S+)/) {
$s.= ($s) ? "and " : "";
$s.="not " if ($1 eq "-");
- $s.="$2* ";
+ $s.="$2$wc ";
} elsif (m/^\s*(and|or|not)\s*$/i) {
$s.="$_ ";
# don't add * to words with less than x chars
} elsif (length($_) <= $MIN_WILDCARD) {
$s.="$_ ";
} else {
- $s.="$_* ";
+ $s.="$_$wc ";
}
}
$s =~ s/\*+/*/g;