117 |
delete $cache->{swish_data}; |
delete $cache->{swish_data}; |
118 |
delete $cache->{swish_exact_data}; |
delete $cache->{swish_exact_data}; |
119 |
delete $cache->{index_data}; |
delete $cache->{index_data}; |
120 |
|
delete $cache->{index_delimiter}; |
121 |
my @page_fields; # names of fields |
my @page_fields; # names of fields |
122 |
|
|
123 |
|
|
165 |
my %page_max = (); |
my %page_max = (); |
166 |
# default line_delimiter if using |
# default line_delimiter if using |
167 |
my $page_line_delimiter = $config->{indexer}->{$field}->{page_line_delimiter} || '<br/>'; |
my $page_line_delimiter = $config->{indexer}->{$field}->{page_line_delimiter} || '<br/>'; |
168 |
|
$cache->{index_delimiter}->{$field} = $config->{indexer}->{$field}->{index_delimiter}; |
169 |
|
|
170 |
foreach my $x (@{$config->{indexer}->{$field}->{$tag}}) { |
foreach my $x (@{$config->{indexer}->{$field}->{$tag}}) { |
171 |
|
|
179 |
my ($s,$se,$d,$i,$il) = (1,0,1,0,0); |
my ($s,$se,$d,$i,$il) = (1,0,1,0,0); |
180 |
$s = 0 if (lc($x->{type}) eq "display"); |
$s = 0 if (lc($x->{type}) eq "display"); |
181 |
$d = 0 if (lc($x->{type}) eq "swish"); |
$d = 0 if (lc($x->{type}) eq "swish"); |
182 |
($s,$se,$d,$i) = (0,0,0,1) if (lc($x->{type}) eq "index"); |
($s,$se,$d,$i) = (0,1,0,1) if (lc($x->{type}) eq "index"); |
183 |
($s,$se,$d,$i) = (0,1,0,0) if (lc($x->{type}) eq "swish_exact"); |
($s,$se,$d,$i) = (0,1,0,0) if (lc($x->{type}) eq "swish_exact"); |
184 |
($s,$se,$d,$i,$il) = (0,1,0,0,1) if (lc($x->{type}) =~ /^lookup/); |
($s,$se,$d,$i,$il) = (0,1,0,0,1) if (lc($x->{type}) =~ /^lookup/); |
185 |
|
|
373 |
} |
} |
374 |
|
|
375 |
if (! $iterate_by_page) { |
if (! $iterate_by_page) { |
376 |
|
my $idel = $x->{index_delimiter}; |
377 |
# fill data in index |
# fill data in index |
378 |
foreach my $d (@index_data) { |
foreach my $tmp (@index_data) { |
379 |
$index->insert($field, $d, $path); |
my $i = $d = $tmp; |
380 |
|
if ($idel && $tmp =~ m/$idel/) { |
381 |
|
($i,$d) = split(/$idel/,$tmp); |
382 |
|
} |
383 |
|
$index->insert($field, $i, $d, $path); |
384 |
} |
} |
385 |
@index_data = (); |
@index_data = (); |
386 |
} |
} |
462 |
$xml .= xmlify($field."_swish_exact", unac_string($codepage,'xxbxx '.$swish_exact_data.' xxexx')); |
$xml .= xmlify($field."_swish_exact", unac_string($codepage,'xxbxx '.$swish_exact_data.' xxexx')); |
463 |
} |
} |
464 |
|
|
465 |
foreach my $d (@{$cache->{index_data}->{$field}->[$page]}) { |
my $idel = $cache->{index_delimiter}->{$field}; |
466 |
$index->insert($field, $d, $path); |
foreach my $tmp (@{$cache->{index_data}->{$field}->[$page]}) { |
467 |
#print STDERR "index $field: $d [$path]\n"; |
my $i = $tmp; |
468 |
|
my $d = $tmp; |
469 |
|
if ($idel && $tmp =~ m/$idel/) { |
470 |
|
($i,$d) = split(/$idel/,$tmp); |
471 |
|
} |
472 |
|
$index->insert($field, $i, $d, $path); |
473 |
|
#print STDERR "index [$idel] $field: $i --> $d [$path]\n"; |
474 |
} |
} |
475 |
} |
} |
476 |
|
|