- ($over_only || eval { $srch->xdb }) ? $srch : undef;
-}
-
-sub over ($) {
- my ($self) = @_;
- my $srch = search($self, 1) or return;
- $self->{over} //= eval {
- my $over = $srch->{over_ro};
- $over->connect; # may fail
+ (eval { $srch->xdb }) ? $srch : undef;
+}
+
+# isrch is preferred for read-only interfaces if available since it
+# reduces kernel cache and FD overhead
+sub isrch { $_[0]->{isrch} // search($_[0]) }
+
+sub over {
+ $_[0]->{over} //= eval {
+ my $srch = $_[0]->{search} //= eval {
+ _cleanup_later($_[0]);
+ require PublicInbox::Search;
+ PublicInbox::Search->new($_[0]);
+ };
+ my $over = PublicInbox::Over->new("$srch->{xpfx}/over.sqlite3");
+ $over->dbh; # may fail