From 097cca4c583a3fe51945406041d1d88c864689a5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 14 Jun 2019 17:42:57 +0000 Subject: search*: rename {partition} => {shard} Another step towards keeping our internal data structures consistent with Xapian naming. --- lib/PublicInbox/Search.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 098c97cd..45431ecc 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"; } } -- cgit v1.2.3-24-ge0c7 From ec32087fbd0af943017d2047eedbdbd59d3291da Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 14 Jun 2019 18:18:06 +0000 Subject: search: use "shard" for local variable Another small step towards terminology consistency with Xapian. --- lib/PublicInbox/Search.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 45431ecc..60fc861a 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -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"; -- cgit v1.2.3-24-ge0c7