-# Copyright (C) 2015-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2019 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# based on notmuch, but with no concept of folders, files or flags
#
sub xdir ($;$) {
my ($self, $rdonly) = @_;
if ($self->{version} == 1) {
- "$self->{mainrepo}/public-inbox/xapian" . SCHEMA_VERSION;
+ "$self->{inboxdir}/public-inbox/xapian" . SCHEMA_VERSION;
} else {
- my $dir = "$self->{mainrepo}/xap" . SCHEMA_VERSION;
+ my $dir = "$self->{inboxdir}/xap" . SCHEMA_VERSION;
return $dir if $rdonly;
- my $part = $self->{partition};
- defined $part or die "partition not given";
- $dir .= "/$part";
+ my $shard = $self->{shard};
+ defined $shard or die "shard not given";
+ $dir .= "/$shard";
}
}
my ($xdb, $slow_phrase);
my $qpf = \($self->{qp_flags} ||= $QP_FLAGS);
if ($self->{version} >= 2) {
- foreach my $part (<$dir/*>) {
- -d $part && $part =~ m!/[0-9]+\z! or next;
- my $sub = Search::Xapian::Database->new($part);
+ foreach my $shard (<$dir/*>) {
+ -d $shard && $shard =~ m!/[0-9]+\z! or next;
+ my $sub = Search::Xapian::Database->new($shard);
if ($xdb) {
$xdb->add_database($sub);
} else {
$xdb = $sub;
}
- $slow_phrase ||= -f "$part/iamchert";
+ $slow_phrase ||= -f "$shard/iamchert";
}
} else {
$slow_phrase = -f "$dir/iamchert";
my ($class, $ibx) = @_;
ref $ibx or die "BUG: expected PublicInbox::Inbox object: $ibx";
my $self = bless {
- mainrepo => $ibx->{mainrepo},
+ inboxdir => $ibx->{inboxdir},
altid => $ibx->{altid},
version => $ibx->{version} // 1,
}, $class;