50 |
|
|
51 |
my %opt; |
my %opt; |
52 |
|
|
53 |
if ( !getopts("cdm:v:i", \%opt ) ) { |
if ( !getopts("cdm:v:ij", \%opt ) ) { |
54 |
print STDERR <<EOF; |
print STDERR <<EOF; |
55 |
usage: $0 [-c|-d] [-m num] [-v|-v level] [-i] |
usage: $0 [-c|-d] [-m num] [-v|-v level] [-i] |
56 |
|
|
59 |
-d delete database before import |
-d delete database before import |
60 |
-m num import just num increments for one host |
-m num import just num increments for one host |
61 |
-v num set verbosity (debug) level (default $debug) |
-v num set verbosity (debug) level (default $debug) |
62 |
-i update HyperEstraier full text index |
-i update Hyper Estraier full text index |
63 |
|
-j update full text, don't check existing files |
64 |
|
|
65 |
|
Option -j is variation on -i. It will allow faster initial creation |
66 |
|
of full-text index from existing database. |
67 |
|
|
68 |
EOF |
EOF |
69 |
exit 1; |
exit 1; |
70 |
} |
} |
109 |
|
|
110 |
my ($host_id, $share_id, $num) = @_; |
my ($host_id, $share_id, $num) = @_; |
111 |
|
|
112 |
|
my $skip_check = $opt{j} && print STDERR "Skipping check for existing files -- this should be used only with initital import\n"; |
113 |
|
|
114 |
unless ($use_hest) { |
unless ($use_hest) { |
115 |
print STDERR "HyperEstraier support not enabled in configuration\n"; |
print STDERR "HyperEstraier support not enabled in configuration\n"; |
116 |
return; |
return; |
197 |
my $fid = $row->{'fid'} || die "no fid?"; |
my $fid = $row->{'fid'} || die "no fid?"; |
198 |
my $uri = 'file:///' . $fid; |
my $uri = 'file:///' . $fid; |
199 |
|
|
200 |
my $id = ($hest_db || $hest_node)->uri_to_id($uri); |
unless ($skip_check) { |
201 |
next unless ($id == -1); |
my $id = ($hest_db || $hest_node)->uri_to_id($uri); |
202 |
|
next unless ($id == -1); |
203 |
|
} |
204 |
|
|
205 |
# create a document object |
# create a document object |
206 |
my $doc = HyperEstraier::Document->new; |
my $doc = HyperEstraier::Document->new; |
256 |
|
|
257 |
|
|
258 |
## update index ## |
## update index ## |
259 |
if (($opt{i} || ($index_path && ! -e $index_path)) && !$opt{c}) { |
if (($opt{i} || $opt{j} || ($index_path && ! -e $index_path)) && !$opt{c}) { |
260 |
# update all |
# update all |
261 |
print "force update of HyperEstraier index "; |
print "force update of HyperEstraier index "; |
262 |
print "importing existing data" unless (-e $index_path); |
print "importing existing data" unless (-e $index_path); |
263 |
print "by -i flag" if ($opt{i}); |
print "by -i flag" if ($opt{i}); |
264 |
|
print "by -j flag" if ($opt{j}); |
265 |
print "\n"; |
print "\n"; |
266 |
hest_update(); |
hest_update(); |
267 |
} |
} |