about summary refs log tree commit homepage
path: root/lib/PublicInbox/Search.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-16 01:04:28 +0000
committerEric Wong <e@80x24.org>2019-06-16 01:04:28 +0000
commitc477bdd8a80eecc319b680764edfb24bd12cb7b2 (patch)
treefb36e978b8dbe1f2228527891d47ef9d69b10591 /lib/PublicInbox/Search.pm
parent044b1d03c76246316d52de4bfd578745a8192398 (diff)
parent27658d2c8b8e51fa64f523c873587273f4f16c46 (diff)
downloadpublic-inbox-c477bdd8a80eecc319b680764edfb24bd12cb7b2.tar.gz
* origin/newspeak:
  comments: replace "partition" with "shard"
  t/xcpdb-reshard: use 'shard' term in local variables
  xapcmd: favor 'shard' over 'part' in local variables
  search: use "shard" for local variable
  v2writable: use "epoch" consistently when referring to git repos
  adminedit: "part" => "shard" for local variables
  v2writable: rename local vars to match Xapian terminology
  v2writable: avoid "part" in internal subs and fields
  search*: rename {partition} => {shard}
  xapcmd: update comments referencing "partitions"
  v2: rename SearchIdxPart => SearchIdxShard
  inboxwritable: s/partitions/shards/ in local var
  tests: change messages to use "shard" instead of partition
  v2writable: rename {partitions} field to {shards}
  v2writable: count_partitions => count_shards
  searchidxpart: start using "shard" in user-visible places
  rename reference to git epochs as "partitions"
  admin|xapcmd: user-facing messages say "shard"
  v2writable: update comments regarding xcpdb --reshard
  doc: rename our Xapian "partitions" to "shards"
Diffstat (limited to 'lib/PublicInbox/Search.pm')
-rw-r--r--lib/PublicInbox/Search.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 098c97cd..60fc861a 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -131,9 +131,9 @@ sub xdir ($;$) {
                 my $dir = "$self->{mainrepo}/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";
         }
 }
 
@@ -143,15 +143,15 @@ sub _xdb ($) {
         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";