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"); |