+sub adump {
+ my ($cb, $mset, $q, $ctx) = @_;
+ my $fh = $cb->([ 200, ['Content-Type' => 'application/atom+xml']]);
+ require PublicInbox::GitCatFile;
+ my $git = PublicInbox::GitCatFile->new($ctx->{git_dir});
+ my $feed_opts = PublicInbox::Feed::get_feedopts($ctx);
+ my $x = PublicInbox::Hval->new_oneline($q->{q})->as_html;
+ $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);
+ PublicInbox::Feed::add_to_feed($feed_opts, $fh, $x, $git);
+ }
+ $git = undef;
+ PublicInbox::Feed::end_feed($fh);
+}
+