diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-04-05 21:45:28 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-04-06 21:18:38 +0000 |
commit | 936670cb83971bf250571a7dd9b0a0a0b33babd8 (patch) | |
tree | 675fa79206f5c1e9f3a13052ddd9d28b69fa67ca /lib/PublicInbox/SearchIdx.pm | |
parent | 9d6468d9560b8cd26ba2529d7a09a93ec5ad8c00 (diff) | |
download | public-inbox-936670cb83971bf250571a7dd9b0a0a0b33babd8.tar.gz |
Dscho found this useful for finding matching git commits based on AuthorDate in git. Add it to the overview DB format, too; so in the future we can support v2 repos without Xapian. https://public-inbox.org/git/nycvar.QRO.7.76.6.1804041821420.55@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz https://public-inbox.org/git/alpine.DEB.2.20.1702041206130.3496@virtualbox/
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r-- | lib/PublicInbox/SearchIdx.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 06bce70a..42562631 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -282,9 +282,14 @@ sub add_message { $smsg->{lines} = $mime->body_raw =~ tr!\n!\n!; defined $bytes or $bytes = length($mime->as_string); $smsg->{bytes} = $bytes; + add_val($doc, PublicInbox::Search::TS(), $smsg->ts); - my $yyyymmdd = strftime('%Y%m%d', gmtime($smsg->ds)); - add_val($doc, PublicInbox::Search::YYYYMMDD, $yyyymmdd); + my @ds = gmtime($smsg->ds); + my $yyyymmdd = strftime('%Y%m%d', @ds); + add_val($doc, PublicInbox::Search::YYYYMMDD(), $yyyymmdd); + my $dt = strftime('%Y%m%d%H%M%S', @ds); + add_val($doc, PublicInbox::Search::DT(), $dt); + my @vals = ($smsg->{ts}, $smsg->{ds}); my $tg = $self->term_generator; @@ -355,7 +360,7 @@ sub add_message { utf8::encode($data); $data = compress($data); - my @vals = ($smsg->ts, $num, $mids, $refs, $xpath, $data); + push @vals, $num, $mids, $refs, $xpath, $data; $self->{over}->add_over(\@vals); $doc->add_boolean_term('Q' . $_) foreach @$mids; $doc->add_boolean_term('XNUM' . $num) if defined $num; |