about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-10-27 07:54:23 +0000
committerEric Wong <e@80x24.org>2020-11-07 10:18:55 +0000
commit549aab226464e93345b466bbf5ae04d952230945 (patch)
treedad6d06ddcef88a934584b3ce7809996d37cb579 /lib/PublicInbox/SearchIdx.pm
parent98c03415fed31cce80f8b2030aee9311890c79d6 (diff)
downloadpublic-inbox-549aab226464e93345b466bbf5ae04d952230945.tar.gz
Having a special init path for external indices is probably
easier than further overloading SearchIdx->new initialization
to work without an Inbox object.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 0458d9c3..029b2726 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -942,4 +942,17 @@ sub worker_done {
         die "$$ $0 still in transaction\n" if $self->{txn};
 }
 
+sub eidx_shard_new {
+        my ($class, $eidx, $shard) = @_;
+        my $self = bless {
+                xpfx => $eidx->{xpfx},
+                indexlevel => $eidx->{indexlevel},
+                -skip_docdata => 1,
+                shard => $shard,
+                creat => 1,
+        }, $class;
+        $self->{-set_indexlevel_once} = 1 if $self->{indexlevel} eq 'medium';
+        $self;
+}
+
 1;