From b503d87a23c90fc0f705a79bce34944e7e20b28b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 10 Feb 2021 18:57:58 -0100 Subject: search: use git approxidate in WWW and "lei q --stdin" This greatly improves the usability of d:, dt:, and rt: search prefixes for users already familiar git's "approxidate" feature. That is, users familiar with the --(since|after|until|before)= options in git-log(1) and similar commands will be able to use those dates in the WWW UI. --- lib/PublicInbox/Mbox.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox/Mbox.pm') diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm index 94f733bc..844099aa 100644 --- a/lib/PublicInbox/Mbox.pm +++ b/lib/PublicInbox/Mbox.pm @@ -237,6 +237,7 @@ sub mbox_all { my $qopts = $ctx->{qopts} = { relevance => -2 }; # ORDER BY docid DESC $qopts->{threads} = 1 if $q->{t}; + $srch->query_approxidate($ctx->{ibx}->git, $q_string); my $mset = $srch->mset($q_string, $qopts); $qopts->{offset} = $mset->size or return [404, [qw(Content-Type text/plain)], -- cgit v1.2.3-24-ge0c7