diff options
author | Eric Wong <e@80x24.org> | 2016-07-31 00:02:06 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-31 23:40:56 +0000 |
commit | 3f4c9ce3d2c0796c6c3f352b5b586ddd7a85ffb0 (patch) | |
tree | 7fa0e627978a1d62024fc70c7b32c57707a2550b /script | |
parent | 3a988efc28064954e64419bb0d368684fa7c7f20 (diff) | |
download | public-inbox-3f4c9ce3d2c0796c6c3f352b5b586ddd7a85ffb0.tar.gz |
This should make tweaking the way we search more efficiet by allowing us to avoid doubling destroying the index every time we want to change something. We also give priority to incremental indexing via public-inbox-{watch,mda} and have manual invocations of public-inbox-index perform batch updates while releasing ssoma.lock.
Diffstat (limited to 'script')
-rwxr-xr-x | script/public-inbox-index | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/script/public-inbox-index b/script/public-inbox-index index 46584c1f..61f21d70 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -8,6 +8,7 @@ use strict; use warnings; +use Getopt::Long qw(:config gnu_getopt no_ignore_case auto_abbrev); my $usage = "public-inbox-index GIT_DIR"; use PublicInbox::Config; eval { require PublicInbox::SearchIdx }; @@ -15,6 +16,11 @@ if ($@) { print STDERR "Search::Xapian required for $0\n"; exit 1; } + +my $reindex; +my %opts = ( '--reindex' => \$reindex ); +GetOptions(%opts) or die "bad command-line args\n$usage"; + my @dirs; sub resolve_git_dir { @@ -57,7 +63,6 @@ foreach my $dir (@dirs) { sub index_dir { my ($git_dir) = @_; -d $git_dir or die "$git_dir does not appear to be a git repository\n"; - my $s = PublicInbox::SearchIdx->new($git_dir, 1); - $s->index_sync; + $s->index_sync({ reindex => $reindex }); } |