-sub load_doc {
- my ($class, $doc) = @_;
- my $self = bless { doc => $doc }, $class;
- $self->load_expand;
+sub psgi_cull ($) {
+ my ($self) = @_;
+ from_name($self); # fill in {from_name} so we can delete {from}
+
+ # drop NNTP-only fields which aren't relevant to PSGI results:
+ # saves ~80K on a 200 item search result:
+ delete @$self{qw(from ts to cc bytes lines)};
+ $self;
+}
+
+# Only called by PSGI interface, not NNTP
+sub from_mitem {
+ my ($mitem, $srch) = @_;
+ return $srch->retry_reopen(\&from_mitem, $mitem) if $srch;
+ my $self = bless {}, __PACKAGE__;
+ psgi_cull(load_expand($self, $mitem->get_document));