+ $qs .= ' type:inbox';
+
+ delete $ctx->{-list}; # reset if retried
+ my $pi_cfg = $ctx->{www}->{pi_cfg};
+ my $user_query = $q->{'q'} // '';
+ if ($user_query =~ /\S/) {
+ $qs = "( $qs ) AND ( $user_query )";
+ } else { # special case for ALL
+ $ctx->ibx_entry($pi_cfg->ALL // die('BUG: ->ALL expected'), {});
+ }
+ my $mset = $misc->mset($qs, $opt); # sorts by $MODIFIED (mtime)
+ my $hide_key = $ctx->hide_key;
+
+ for my $mi ($mset->items) {
+ my $doc = $mi->get_document;
+ my ($eidx_key) = PublicInbox::Search::xap_terms('Q', $doc);
+ $eidx_key // next;
+ my $ibx = $pi_cfg->lookup_eidx_key($eidx_key) // next;
+ next if $ibx->{-hide}->{$hide_key};
+ grep(/$re/, @{$ibx->{url} // []}) or next;
+ $ctx->ibx_entry($ibx, $misc->doc2ibx_cache_ent($doc));
+ if ($r) { # for descriptions in search_nav_bot
+ my $pct = PublicInbox::Search::get_pct($mi);
+ # only when sorting by relevance, ->items is always
+ # ordered descending:
+ $max //= $pct;
+ $min = $pct;
+ }
+ }
+ if ($r) { # for descriptions in search_nav_bot
+ $q->{-min_pct} = $min;
+ $q->{-max_pct} = $max;
+ }
+ $ctx->{-mset} = $mset;
+ psgi_triple($ctx);