diff options
author | Eric Wong <e@80x24.org> | 2020-12-17 03:39:49 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-12-19 09:32:08 +0000 |
commit | ba135f3e25bf5d1b3aa3d34e31fefb55ee4c8d29 (patch) | |
tree | 591c59df84844c8383c103f3b23b0dc9394e763e /lib/PublicInbox/V2Writable.pm | |
parent | 475e6b6a722361223505a7fcb084f5e729c69240 (diff) | |
download | public-inbox-ba135f3e25bf5d1b3aa3d34e31fefb55ee4c8d29.tar.gz |
search: simplify initialization, add ->xdb_shards_flat
This reduces differences between v1 and v2 code, and introduces ->xdb_shards_flat to provide read-only access to shards without using Xapian::MultiDatabase. This will allow us to combine shards of several inboxes AND extindexes for lei.
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r-- | lib/PublicInbox/V2Writable.pm | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index e8a5fbd2..7d41b0f6 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -73,13 +73,7 @@ sub count_shards ($) { delete $ibx->{search}; $srch->{nshard} // 0 } else { # ExtSearchIdx - $self->{nshard} // do { - if ($self->xdb_sharded) { - $self->{nshard} // die 'BUG: {nshard} unset'; - } else { - 0; - } - } + $self->{nshard} ||= scalar($self->xdb_shards_flat); } } |