From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 09/14] search: rename "ts:" prefix to "rt:"
Date: Wed, 13 Jan 2021 19:06:22 -1200 [thread overview]
Message-ID: <20210114070627.18195-10-e@80x24.org> (raw)
In-Reply-To: <20210114070627.18195-1-e@80x24.org>
Meaning "Received time", as it is the best description of the
value we use from the "Received:" header, if present. JMAP
calls it "receivedAt", but "rt:" seems like a better
abbreviation being in line with "dt:" for the "Date" header.
"Timestamp" ("ts") was potentially ambiguous given the presence
of the "Date" header.
---
lib/PublicInbox/IMAPsearchqp.pm | 6 +++---
lib/PublicInbox/LeiOverview.pm | 2 +-
lib/PublicInbox/Search.pm | 2 +-
t/imap_searchqp.t | 6 +++---
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/PublicInbox/IMAPsearchqp.pm b/lib/PublicInbox/IMAPsearchqp.pm
index 78d9a206..2fb92bb8 100644
--- a/lib/PublicInbox/IMAPsearchqp.pm
+++ b/lib/PublicInbox/IMAPsearchqp.pm
@@ -124,7 +124,7 @@ sub ON {
my ($self, $item) = @_;
my $ts = yyyymmdd($item);
my $end = $ts + 86399; # no leap day
- push @{$self->{xap}}, "ts:$ts..$end";
+ push @{$self->{xap}}, "rt:$ts..$end";
my $sql = $self->{sql} or return 1;
$$sql .= " AND ts >= $ts AND ts <= $end";
}
@@ -132,7 +132,7 @@ sub ON {
sub BEFORE {
my ($self, $item) = @_;
my $ts = yyyymmdd($item);
- push @{$self->{xap}}, "ts:..$ts";
+ push @{$self->{xap}}, "rt:..$ts";
my $sql = $self->{sql} or return 1;
$$sql .= " AND ts <= $ts";
}
@@ -140,7 +140,7 @@ sub BEFORE {
sub SINCE {
my ($self, $item) = @_;
my $ts = yyyymmdd($item);
- push @{$self->{xap}}, "ts:$ts..";
+ push @{$self->{xap}}, "rt:$ts..";
my $sql = $self->{sql} or return 1;
$$sql .= " AND ts >= $ts";
}
diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm
index 194c5e28..080fe837 100644
--- a/lib/PublicInbox/LeiOverview.pm
+++ b/lib/PublicInbox/LeiOverview.pm
@@ -86,7 +86,7 @@ sub _unbless_smsg {
my ($smsg, $mitem) = @_;
delete @$smsg{qw(lines bytes num tid)};
- $smsg->{rcvd} = _iso8601(delete $smsg->{ts}); # JMAP receivedAt
+ $smsg->{rt} = _iso8601(delete $smsg->{ts}); # JMAP receivedAt
$smsg->{dt} = _iso8601(delete $smsg->{ds}); # JMAP UTCDate
$smsg->{relevance} = get_pct($mitem) if $mitem;
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm
index 7f68ee01..a4b40f94 100644
--- a/lib/PublicInbox/Search.pm
+++ b/lib/PublicInbox/Search.pm
@@ -376,7 +376,7 @@ sub qparse_new ($) {
# for IMAP, undocumented for WWW and may be split off go away
$cb->($qp, $NVRP->new(BYTES, 'bytes:'));
- $cb->($qp, $NVRP->new(TS, 'ts:'));
+ $cb->($qp, $NVRP->new(TS, 'rt:'));
$cb->($qp, $NVRP->new(UID, 'uid:'));
while (my ($name, $prefix) = each %bool_pfx_external) {
diff --git a/t/imap_searchqp.t b/t/imap_searchqp.t
index 049fd680..6b4121ea 100644
--- a/t/imap_searchqp.t
+++ b/t/imap_searchqp.t
@@ -76,17 +76,17 @@ is($q->{xap}, 'c:"b" d:..19931002', 'compound query w/ parens');
$q = $parse->($s = qq{BEFORE 2-Oct-1993});
is_deeply($q->{sql}, \" AND ts <= $t0", 'BEFORE SQL');
$q = $parse->("FROM z $s");
- is($q->{xap}, qq{f:"z" ts:..$t0}, 'BEFORE Xapian');
+ is($q->{xap}, qq{f:"z" rt:..$t0}, 'BEFORE Xapian');
$q = $parse->($s = qq{SINCE 2-Oct-1993});
is_deeply($q->{sql}, \" AND ts >= $t0", 'SINCE SQL');
$q = $parse->("FROM z $s");
- is($q->{xap}, qq{f:"z" ts:$t0..}, 'SINCE Xapian');
+ is($q->{xap}, qq{f:"z" rt:$t0..}, 'SINCE Xapian');
$q = $parse->($s = qq{ON 2-Oct-1993});
is_deeply($q->{sql}, \" AND ts >= $t0 AND ts <= $t1", 'ON SQL');
$q = $parse->("FROM z $s");
- is($q->{xap}, qq{f:"z" ts:$t0..$t1}, 'ON Xapian');
+ is($q->{xap}, qq{f:"z" rt:$t0..$t1}, 'ON Xapian');
}
{
next prev parent reply other threads:[~2021-01-14 7:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-14 7:06 [PATCH 00/14] lei: another pile of changes Eric Wong
2021-01-14 7:06 ` [PATCH 01/14] cmd_ipc: support + test EINTR + EAGAIN, no FDs Eric Wong
2021-01-14 7:06 ` [PATCH 02/14] lei: test SIGPIPE, stop xsearch workers on client abort Eric Wong
2021-01-14 7:06 ` [PATCH 03/14] daemon+watch: fix localization of %SIG for non-signalfd users Eric Wong
2021-01-14 7:06 ` [PATCH 04/14] lei: do not unlink socket path at exit Eric Wong
2021-01-14 7:06 ` [PATCH 05/14] lei: reduce live FD references in wq child Eric Wong
2021-01-14 7:06 ` [PATCH 06/14] lei: rely on localized $current_lei for warnings Eric Wong
2021-01-14 7:06 ` [PATCH 07/14] lei_dedupe+shared_kv: ensure round-tripping serialization Eric Wong
2021-01-14 7:06 ` [PATCH 08/14] lei q: reinstate smsg dedupe Eric Wong
2021-01-14 7:06 ` Eric Wong [this message]
2021-01-14 7:06 ` [PATCH 10/14] lei_overview: rename "references" to "refs" Eric Wong
2021-01-14 7:06 ` [PATCH 11/14] lei: q: lock stdout on overview output Eric Wong
2021-01-15 0:18 ` Eric Wong
2021-01-14 7:06 ` [PATCH 12/14] leixsearch: remove some commented out code Eric Wong
2021-01-14 7:06 ` [PATCH 13/14] lei: remove temporary var on open Eric Wong
2021-01-14 7:06 ` [PATCH 14/14] lei: pass FD to CWD via cmsg, use fchdir on server Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210114070627.18195-10-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).