41 |
$labels{$_->{value}} = x($_->{content}); |
$labels{$_->{value}} = x($_->{content}); |
42 |
} |
} |
43 |
|
|
44 |
|
my $path = param('path'); # limit to this path |
45 |
|
my %path_label; |
46 |
|
my @path_name; |
47 |
|
foreach (@{$config->{paths}->{path}}) { |
48 |
|
push @path_name,x($_->{limit}); |
49 |
|
$path_label{$_->{limit}} = x($_->{content}); |
50 |
|
} |
51 |
|
|
52 |
if ($config->{charset}) { |
if ($config->{charset}) { |
53 |
print header(-charset=>x($config->{charset})); |
print header(-charset=>x($config->{charset})); |
54 |
} else { |
} else { |
61 |
print textfield('search'); |
print textfield('search'); |
62 |
print submit(-value=> x($config->{text}->{submit})); |
print submit(-value=> x($config->{text}->{submit})); |
63 |
print checkbox(-name=>'no_affix', -checked=>0, -label=>x($config->{text}->{no_spell})) if ($spelling_alt); |
print checkbox(-name=>'no_affix', -checked=>0, -label=>x($config->{text}->{no_spell})) if ($spelling_alt); |
64 |
|
if (@path_name) { |
65 |
|
print br,x($config->{text}->{limit}); |
66 |
|
print popup_menu(-name=>'path',-values=>\@path_name,-labels=>\%path_label,-default=>$path); |
67 |
|
} |
68 |
print end_form,hr; |
print end_form,hr; |
69 |
|
|
70 |
if (param('search')) { |
if (param('search')) { |
107 |
$s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/; |
$s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/; |
108 |
$s=~s/\*\*+/*/g; |
$s=~s/\*\*+/*/g; |
109 |
|
|
110 |
|
# limit to some path |
111 |
|
$s = "swishdocpath=(\"$path\") and $s" if ($path); |
112 |
|
|
113 |
|
my %params; # optional parametars for swish |
114 |
|
|
115 |
my @properties = split(/\s+/,x($config->{properties})); |
my @properties = split(/\s+/,x($config->{properties})); |
116 |
|
$params{properties} = \@properties if (@properties); |
117 |
|
|
118 |
my $sh = SWISH->connect('Fork', |
my $sh = SWISH->connect('Fork', |
119 |
prog => x($config->{prog}), |
prog => x($config->{prog}), |
120 |
indexes => x($config->{index}), |
indexes => x($config->{index}), |
|
properties => \@properties, |
|
121 |
results => sub { |
results => sub { |
122 |
my ($sh,$hit) = @_; |
my ($sh,$hit) = @_; |
123 |
|
|
136 |
# print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields; |
# print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields; |
137 |
}, |
}, |
138 |
maxhits => param('max_hits') || $max_hits, |
maxhits => param('max_hits') || $max_hits, |
139 |
|
\%params, |
140 |
); |
); |
141 |
|
|
142 |
die $SWISH::errstr unless $sh; |
die $SWISH::errstr unless $sh; |