1 # Copyright (C) 2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 # Read-only external (detached) index for cross inbox search.
5 # This is a read-only counterpart to PublicInbox::ExtSearchIdx
6 # and behaves like PublicInbox::Inbox AND PublicInbox::Search
7 package PublicInbox::ExtSearch;
10 use PublicInbox::Over;
11 use PublicInbox::Inbox;
14 # for ->reopen, ->mset, ->mset_to_artnums
15 use parent qw(PublicInbox::Search);
18 my (undef, $topdir) = @_;
19 $topdir = File::Spec->canonpath($topdir);
23 xpfx => "$topdir/ei".PublicInbox::Search::SCHEMA_VERSION
27 sub search { $_[0] } # self
29 # overrides PublicInbox::Search::_xdb
35 # same as per-inbox ->over, for now...
38 $self->{over} //= PublicInbox::Over->new("$self->{xpfx}/over.sqlite3");
43 $self->{git} //= PublicInbox::Git->new("$self->{topdir}/ALL.git");
52 ($self->{description} //=
53 PublicInbox::Inbox::cat_desc("$self->{topdir}/description")) //
54 '$EINDEX_DIR/description missing';
57 sub cloneurl { [] } # TODO
59 sub base_url { 'https://example.com/TODO/' }
63 *smsg_eml = \&PublicInbox::Inbox::smsg_eml;
64 *smsg_by_mid = \&PublicInbox::Inbox::smsg_by_mid;
65 *msg_by_mid = \&PublicInbox::Inbox::msg_by_mid;
66 *modified = \&PublicInbox::Inbox::modified;
67 *recent = \&PublicInbox::Inbox::recent;
69 *max_git_epoch = *nntp_usable = *msg_by_path = \&mm; # undef