}
}
$s =~ s/\*+/*/g;
+ $s =~ s/[()]//g; # () are used in query language
$s = $pre.$s.$post if ($q->param("e$i"));
push @swish_q,$s;
}
my $tmpl = $self->load_tmpl(url_ex($q,'results.html'), global_vars => 1, die_on_bad_params => 0);
- $tmpl->param('url_params',"?".join("&",@url_params));
-
sub esc_html {
my $html = shift;
$html =~ s/</</g;
$sort = $sortby;
push @persist_vars, "sortby";
}
- $tmpl->param('url_params_paths',"?".join("&",@url_params).'&'.join("&",map { my $t = $_; $t =~ s/\#/%23/g; "path=$t"; } @path_arr));
+ # used to filter entries in index and swish
+ my $filter = $q->param("filter");
# construct swish query
my $sw_q = join(" and ",@s_arr);
if (@path_arr && $q->param('show_full')) {
- $sw_q .= "and (swishdocpath=\"";
+ $sw_q .= " and (swishdocpath=\"";
$sw_q .= join("\" or swishdocpath=\"",@path_arr);
$sw_q .= "\")";
$tmpl->param('full',1); # show full records
+# } elsif (@path_arr && $#path_arr == 0) {
+# # I will assume that it's a filter since there isn't show_full
+# $filter = shift @path_arr;
} elsif ($q->param('show_full')) {
# just show full path, no path defined
$tmpl->param('full',1);
$tmpl->param('full',0);
}
+ if ($filter) {
+ $sw_q .= " and (swishdocpath=\"$filter\")" unless (@path_arr);
+ push @persist_vars, "filter";
+ push @url_params, "filter=$filter";
+ push @url_params_persist, "filter=$filter";
+ }
+
my $swish_msg = ' ';
# create new swish instance
$tmpl->param('PAGER_offset',$q->param("PAGER_offset") || 0);
$tmpl->param('last_PAGER_offset',$q->param("last_PAGER_offset") || 0);
+ # URL parametars for search results
+ $tmpl->param('url_params',"?".join("&",@url_params));
+ $tmpl->param('url_params_paths',"?".join("&",@url_params).'&'.join("&",map { my $t = $_; $t =~ s/\#/%23/g; "path=$t"; } @path_arr));
+
+
+
#
# build pager
#