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;
13 use PublicInbox::MiscSearch;
15 # for ->reopen, ->mset, ->mset_to_artnums
16 use parent qw(PublicInbox::Search);
19 my (undef, $topdir) = @_;
20 $topdir = File::Spec->canonpath($topdir);
24 xpfx => "$topdir/ei".PublicInbox::Search::SCHEMA_VERSION
30 $self->{misc} //= PublicInbox::MiscSearch->new("$self->{xpfx}/misc");
33 sub search { $_[0] } # self
35 # overrides PublicInbox::Search::_xdb
41 # same as per-inbox ->over, for now...
44 $self->{over} //= PublicInbox::Over->new("$self->{xpfx}/over.sqlite3");
49 $self->{git} //= PublicInbox::Git->new("$self->{topdir}/ALL.git");
58 ($self->{description} //=
59 PublicInbox::Inbox::cat_desc("$self->{topdir}/description")) //
60 '$EXTINDEX_DIR/description missing';
63 sub cloneurl { [] } # TODO
65 sub base_url { 'https://example.com/TODO/' }
69 *smsg_eml = \&PublicInbox::Inbox::smsg_eml;
70 *smsg_by_mid = \&PublicInbox::Inbox::smsg_by_mid;
71 *msg_by_mid = \&PublicInbox::Inbox::msg_by_mid;
72 *modified = \&PublicInbox::Inbox::modified;
73 *recent = \&PublicInbox::Inbox::recent;
75 *max_git_epoch = *nntp_usable = *msg_by_path = \&mm; # undef