25 |
|
|
26 |
=head1 VERSION |
=head1 VERSION |
27 |
|
|
28 |
Version 0.04 |
Version 0.05 |
29 |
|
|
30 |
=cut |
=cut |
31 |
|
|
32 |
our $VERSION = '0.04'; |
our $VERSION = '0.05'; |
33 |
|
|
34 |
=head1 SYNOPSIS |
=head1 SYNOPSIS |
35 |
|
|
93 |
if ( ! -e $self->path ) { |
if ( ! -e $self->path ) { |
94 |
mkpath $self->path || $log->logdie("can't create ", $self->path,": $!"); |
mkpath $self->path || $log->logdie("can't create ", $self->path,": $!"); |
95 |
$log->info("created ", $self->path); |
$log->info("created ", $self->path); |
96 |
|
} elsif ( $self->clean ) { |
97 |
|
$log->info("removing existing ", $self->path); |
98 |
|
rmtree $self->path || $log->logdie("can't remove ", $self->path,": $!"); |
99 |
|
mkpath $self->path || $log->logdie("can't create ", $self->path,": $!"); |
100 |
} |
} |
101 |
|
|
102 |
my $path = $self->path . '/' . $self->database; |
my $path = $self->path . '/' . $self->database; |
136 |
|
|
137 |
my $hash = $self->ds_to_hash( $ds, 'search' ) || return; |
my $hash = $self->ds_to_hash( $ds, 'search' ) || return; |
138 |
|
|
139 |
warn "add( $id, ",dump($ds)," ) => ", dump( $hash ); |
$hash->{database} ||= $self->database; |
140 |
|
$hash->{id} ||= $id; |
141 |
|
|
142 |
|
$log->debug("add( $id, ", sub { dump($ds) }," ) => ", sub { dump( $hash ) }); |
143 |
|
|
144 |
$self->index->add_doc( $hash ); |
$self->index->add_doc( $hash ); |
145 |
|
|