17 |
|
|
18 |
=head1 VERSION |
=head1 VERSION |
19 |
|
|
20 |
Version 0.05 |
Version 0.07 |
21 |
|
|
22 |
=cut |
=cut |
23 |
|
|
24 |
our $VERSION = '0.05'; |
our $VERSION = '0.07'; |
25 |
|
|
26 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
27 |
|
|
90 |
my $url = $self->{masterurl} . '/node/' . $self->{database}; |
my $url = $self->{masterurl} . '/node/' . $self->{database}; |
91 |
$self->{url} = $url; |
$self->{url} = $url; |
92 |
|
|
93 |
$log->info("opening Hyper Estraier index $self->{url}"); |
$log->debug("opening index $self->{url}"); |
94 |
|
|
95 |
my $nodes = $self->master( action => 'nodelist' ); |
my $nodes = $self->master( action => 'nodelist' ); |
96 |
|
|
97 |
$log->debug("nodes found: $nodes"); |
$log->debug("nodes found: $nodes"); |
98 |
|
|
99 |
if ($nodes !~ m/^$self->{database}\t/sm) { |
if ($nodes !~ m/^$self->{database}\t/sm) { |
100 |
$log->info("creating index $url"); |
$log->warn("creating index $url"); |
101 |
$self->master( |
$self->master( |
102 |
action => 'nodeadd', |
action => 'nodeadd', |
103 |
name => $self->{database}, |
name => $self->{database}, |
109 |
$self->{'db'}->set_auth($self->{'user'}, $self->{passwd}); |
$self->{'db'}->set_auth($self->{'user'}, $self->{passwd}); |
110 |
|
|
111 |
my $encoding = $self->{'encoding'} || 'ISO-8859-2'; |
my $encoding = $self->{'encoding'} || 'ISO-8859-2'; |
112 |
$log->info("using encoding $encoding"); |
$log->info("using index $self->{url} with encoding $encoding"); |
113 |
|
|
114 |
$self->{'iconv'} = new Text::Iconv($encoding, 'UTF-8') or |
$self->{'iconv'} = new Text::Iconv($encoding, 'UTF-8') or |
115 |
$log->logdie("can't create conversion from $encoding to UTF-8"); |
$log->logdie("can't create conversion from $encoding to UTF-8"); |
239 |
validate => 'master', |
validate => 'master', |
240 |
rest_url => $self->{masterurl} . '/master?action=' . $action , |
rest_url => $self->{masterurl} . '/master?action=' . $action , |
241 |
action => $action, |
action => $action, |
242 |
|
%{ $args }, |
243 |
); |
); |
244 |
} |
} |
245 |
|
|
263 |
|
|
264 |
$log->debug("got labels: ", join("|", @labels)); |
$log->debug("got labels: ", join("|", @labels)); |
265 |
|
|
266 |
@labels = grep(/^$args->{to}/, @labels); |
@labels = grep(/^$args->{to}\t/, @labels); |
267 |
|
my $label = shift @labels; |
268 |
my (undef,$label) = split(/\t/, shift @labels); |
$label = split(/\t/, $label)->[1] if ($label); |
269 |
|
|
270 |
if (! $label) { |
if (! $label) { |
271 |
$log->warn("can't find label for $args->{to}, skipping link creaton"); |
$log->warn("can't find label for $args->{to}, skipping link creaton"); |
323 |
$del = '&'; |
$del = '&'; |
324 |
} |
} |
325 |
|
|
326 |
$url_args =~ s#^\&#?# if ($url =~ m#\?#); |
$url .= $url_args if ($url_args); |
|
$url .= $url_args; |
|
327 |
|
|
328 |
$log->debug("calling $url"); |
$log->debug("calling $url"); |
329 |
|
|