- my $fh = $cb->([ 200, ['Content-Type' => 'application/atom+xml']]);
- my $ibx = $ctx->{-inbox};
- my $feed_opts = PublicInbox::Feed::get_feedopts($ctx);
- my $x = ascii_html($q->{'q'});
- $x = qq{$x - search results};
- $feed_opts->{atomurl} = $feed_opts->{url} . '?'. $q->qs_html;
- $feed_opts->{url} .= '?'. $q->qs_html(x => undef);
- $x = PublicInbox::Feed::atom_header($feed_opts, $x);
- $fh->write($x. PublicInbox::Feed::feed_updated());
-
- for ($mset->items) {
- $x = PublicInbox::SearchMsg->load_doc($_->get_document)->mid;
- $x = mid2path($x);
- my $s = PublicInbox::Feed::feed_entry($feed_opts, $x, $ibx);
- $fh->write($s) if defined $s;
- }
- PublicInbox::Feed::end_feed($fh);
-}
-
-package PublicInbox::SearchQuery;
-use strict;
-use warnings;
-use PublicInbox::Hval;
-use PublicInbox::MID qw(mid_escape);
-
-sub new {
- my ($class, $qp) = @_;
-
- my $r = $qp->{r};
- bless {
- q => $qp->{'q'},
- x => $qp->{x} || '',
- o => (($qp->{o} || '0') =~ /(\d+)/),
- r => (defined $r && $r ne '0'),
- }, $class;
+ $ctx->{ids} = $ctx->{-inbox}->search->mset_to_artnums($mset);
+ $ctx->{search_query} = $q; # used by WwwAtomStream::atom_header
+ PublicInbox::WwwAtomStream->response($ctx, 200, \&adump_i);