8 |
use SWISH; |
use SWISH; |
9 |
use Unicode::String qw(utf8 utf16); |
use Unicode::String qw(utf8 utf16); |
10 |
require Unicode::Map8; |
require Unicode::Map8; |
11 |
|
use DBI; |
12 |
|
|
13 |
# configuration options |
# configuration options |
14 |
# FIX: they really should go in configuration file! |
# FIX: they really should go in configuration file! |
26 |
$self->run_modes( |
$self->run_modes( |
27 |
'search' => 'show_search_form', |
'search' => 'show_search_form', |
28 |
'results' => 'show_results_list', |
'results' => 'show_results_list', |
29 |
# 'user' => 'show_user_detail' |
# 'user' => 'show_user_detail', |
30 |
|
'index' => 'show_index', |
31 |
); |
); |
32 |
$self->start_mode('search'); |
$self->start_mode('search'); |
33 |
$self->mode_param('rm'); |
$self->mode_param('rm'); |
58 |
my @swish_results; # results from swish |
my @swish_results; # results from swish |
59 |
|
|
60 |
# load template for this page |
# load template for this page |
|
my $tmpl = $self->load_tmpl('results.html'); |
|
61 |
|
|
62 |
my @s_arr; # all queries are located here |
my @s_arr; # all queries are located here |
63 |
|
|
64 |
for(my $i = 1; $i <=10; $i++) { |
for(my $i = 1; $i <=10; $i++) { |
65 |
|
|
66 |
last if (! $q->param("f$i")); |
return show_index($self, $i) if ($q->param("f".$i."_index")); |
67 |
|
next if (! $q->param("f$i")); |
68 |
next if (! $q->param("v$i")); |
next if (! $q->param("v$i")); |
69 |
|
|
70 |
# re-write query from +/- to and/and not |
# re-write query from +/- to and/and not |
86 |
} |
} |
87 |
} |
} |
88 |
|
|
89 |
push @s_arr,$q->param("f$i")."=($s)"; |
push @s_arr,$q->param("f$i")."_swish=($s)"; |
90 |
} |
} |
91 |
|
|
92 |
|
my $tmpl = $self->load_tmpl('results.html'); |
93 |
|
|
94 |
my $l2_map = Unicode::Map8->new($CHARSET) || die; |
my $l2_map = Unicode::Map8->new($CHARSET) || die; |
95 |
my $us = Unicode::String->new(); |
my $us = Unicode::String->new(); |
96 |
|
|
165 |
return $html; |
return $html; |
166 |
} |
} |
167 |
|
|
168 |
|
sub show_index { |
169 |
|
my $self = shift; |
170 |
|
my $i = shift; # field number |
171 |
|
|
172 |
|
my $q = $self->query(); |
173 |
|
|
174 |
|
my $html; |
175 |
|
|
176 |
|
$html .= "show index of ".$q->param("f$i")." for ".$q->param("v$i"); |
177 |
|
|
178 |
|
|
179 |
|
return $html; |
180 |
|
} |
181 |
|
|
182 |
1; |
1; |