diff options
author | Eric Wong <e@80x24.org> | 2021-03-20 18:40:31 +0600 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-21 09:46:51 +0000 |
commit | a82e09c5e2ded9bc771cfae0fc5e267b063020ba (patch) | |
tree | 8d1d674a997a5819281edda610af8d140e84cb7d /lib/PublicInbox | |
parent | 0b3d4d72297f82cb43993074dfc4650a01f75683 (diff) | |
download | public-inbox-a82e09c5e2ded9bc771cfae0fc5e267b063020ba.tar.gz |
Stop showing `docid' since it's not useful with shards. `bytes' and `lines' are probably noise, but maybe could be visible in some "fuller" view. v2: t/lei_xsearch: fix warnings from {docid} removal
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r-- | lib/PublicInbox/LeiOverview.pm | 8 | ||||
-rw-r--r-- | lib/PublicInbox/LeiXSearch.pm | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index 521bca50..1ce2a098 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -136,7 +136,10 @@ sub ovv_end { sub _unbless_smsg { my ($smsg, $mitem) = @_; - delete @$smsg{qw(lines bytes num tid)}; + # TODO: make configurable + # num/tid are nonsensical with multi-inbox search, + # lines/bytes are not generally useful + delete @$smsg{qw(num tid lines bytes)}; $smsg->{rt} = _iso8601(delete $smsg->{ts}); # JMAP receivedAt $smsg->{dt} = _iso8601(delete $smsg->{ds}); # JMAP UTCDate $smsg->{pct} = get_pct($mitem) if $mitem; @@ -151,7 +154,8 @@ sub _unbless_smsg { $smsg->{substr($f, 0, 1)} = pairs($v); } $smsg->{'s'} = delete $smsg->{subject}; - scalar { %$smsg }; # unbless + my $kw = delete($smsg->{kw}); + scalar { %$smsg, ($kw && scalar(@$kw) ? (kw => $kw) : ()) }; # unbless } sub ovv_atexit_child { diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 57717b87..17171a7f 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -70,6 +70,8 @@ sub mitem_kw ($$;$) { my ($smsg, $mitem, $flagged) = @_; my $kw = xap_terms('K', $mitem->get_document); $kw->{flagged} = 1 if $flagged; + # we keep the empty array here to prevent expensive work in + # ->xsmsg_vmd, _unbless_smsg will clobber it iff it's empty $smsg->{kw} = [ sort keys %$kw ]; } @@ -85,7 +87,6 @@ sub smsg_for { my $smsg = $ibx->over->get_art($num); return if $smsg->{bytes} == 0; mitem_kw($smsg, $mitem) if $ibx->can('msg_keywords'); - $smsg->{docid} = $docid; $smsg; } |