32 |
|
|
33 |
getopts('d:m:qs', \%opts); |
getopts('d:m:qs', \%opts); |
34 |
|
|
35 |
my $db_dir; |
my $path; # this is name of database |
36 |
|
|
37 |
Text::Iconv->raise_error(1); # Conversion errors raise exceptions |
Text::Iconv->raise_error(1); # Conversion errors raise exceptions |
38 |
|
|
124 |
if ($filter) { |
if ($filter) { |
125 |
no strict 'refs'; |
no strict 'refs'; |
126 |
$swish_data .= join(" ",&$filter($swish)); |
$swish_data .= join(" ",&$filter($swish)); |
|
print STDERR "#### $swish_data\n"; |
|
127 |
} else { |
} else { |
128 |
$swish_data .= $swish; |
$swish_data .= $swish; |
129 |
} |
} |
153 |
if ($filter) { |
if ($filter) { |
154 |
no strict 'refs'; |
no strict 'refs'; |
155 |
foreach my $d (&$filter($index_data)) { |
foreach my $d (&$filter($index_data)) { |
156 |
$index->insert($field, $d, $db_dir); |
$index->insert($field, $d, $path); |
157 |
} |
} |
158 |
} else { |
} else { |
159 |
$index->insert($field, $index_data, $db_dir); |
$index->insert($field, $index_data, $path); |
160 |
} |
} |
161 |
} |
} |
162 |
} |
} |
252 |
$last_p = $p; |
$last_p = $p; |
253 |
} |
} |
254 |
|
|
255 |
if (my $xml = $cp2utf->convert(isis2xml($row,$add_xml))) { |
my $swishpath = $path."#".int($row->{mfn}); |
256 |
|
|
257 |
|
if (my $xml = $cp2utf->convert(isis2xml($row,$add_xml."<path>$swishpath</path>"))) { |
258 |
use bytes; # as opposed to chars |
use bytes; # as opposed to chars |
259 |
print "Path-Name: $path#".int($row->{mfn})."\n"; |
print "Path-Name: $swishpath\n"; |
260 |
print "Content-Length: ".(length($xml)+1)."\n"; |
print "Content-Length: ".(length($xml)+1)."\n"; |
261 |
print "Document-Type: XML\n\n$xml\n"; |
print "Document-Type: XML\n\n$xml\n"; |
262 |
} |
} |