-sub ibx_entry {
- my ($mtime, $ibx, $env) = @_;
- my $ts = PublicInbox::View::fmt_ts($mtime);
- my $url = PublicInbox::Hval::prurl($env, $ibx->{url});
- my $tmp = <<"";
-* $ts - $url
- ${\$ibx->description}
+sub response {
+ my ($class, $ctx) = @_;
+ bless $ctx, $class;
+ my ($re, $qs) = $ctx->url_filter;
+ $re // return $ctx->psgi_triple;
+ if (my $ALL = $ctx->{www}->{pi_cfg}->ALL) { # fast path
+ # FIXME: test this in t/
+ $ALL->misc->reopen->retry_reopen(\&add_misc_ibx,
+ $ctx, $re, $qs);
+ } else { # slow path, no [extindex "all"] configured
+ my $iter = PublicInbox::ConfigIter->new($ctx->{www}->{pi_cfg},
+ \&list_match_i, $re, $ctx);
+ sub {
+ $ctx->{-wcb} = $_[0]; # HTTP server callback
+ $ctx->{env}->{'pi-httpd.async'} ?
+ $iter->event_step : $iter->each_section;
+ }
+ }
+}
+
+sub mset_footer ($$) {
+ my ($ctx, $mset) = @_;
+ # no footer if too few matches
+ return '' if $mset->get_matches_estimated == $mset->size;
+ require PublicInbox::SearchView;
+ PublicInbox::SearchView::search_nav_bot($mset, $ctx->{-sq});
+}