From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: JSON field names in terminal/pager output
Date: Tue, 5 Jan 2021 09:56:46 +0000 [thread overview]
Message-ID: <20210105095646.GA26897@dcvr> (raw)
Are "f", "s", "t", "c" acceptable field names to show in JSON
output? (instead of from/subject/to/cc)
The single-chars have been used in the search queries for as
long as we've had search. And I stole that UI bit from
mairix(1), so there's prior art.
Anyways, the current JSON output looks something like the
following, comments inline
[{
"blob": "d21717dae7e18dbc9efcd5ca57fe2ee92747bc06",
"docid": 41946,
"dt": "2021-01-05T09:24:49Z",
# dt: is not an exact match for current WWW behavior which
# needs YYYYMMDDHHMMSS (all digits). Getting Xapian to parse
# dates from Perl (w/o custom C++) isn't possible, yet.
# dt: is the date header, "UTCDate" in JMAP.
"f": "Eric Wong <e@80x24.org>",
# "from": might be more obvious, but seeing it thousands of
# times every message might be too much
"m": "<20210105092449.GA22853@dcvr>",
# mid/msgid/message-id
"rcvd": "2021-01-05T09:24:49Z",
# IMAP calls this INTERNALDATE, JMAP calls it "receivedAt"
"references": [
"<20210105090437.22801-1-e@80x24.org>",
"<20210105090437.22801-5-e@80x24.org>"
],
# we don't actually support searching on rereference, yet;
# not sure if it's needed since we already do thread # expansion
"relevance": 13,
# relevance is ->get_percent from Xapian
"s": "JSON pretty-printing [was: [4/4] ... (and maybe lei)]",
"t": "meta@public-inbox.org"
# Subject and To: headers
}, {
# Another message, we do "}, {" to save vertical white space
rather than "},\n{"
"blob": "0ee1d7d9ec9b29c1d8f103033ed06e9e48e6ebfe",
"docid": 41930,
# side note: it's probably not worth displaying docid for
# ephemeral search indices like LeiXSearch
"dt": "2021-01-05T09:04:36Z",
"f": "Eric Wong <e@80x24.org>",
"m": "<20210105090437.22801-4-e@80x24.org>",
"rcvd": "2021-01-05T09:04:38Z",
"references": [
"<20210105090437.22801-1-e@80x24.org>"
],
"relevance": 36,
"s": "[PATCH 3/4] lei: use client env as-is, drop daemon-env command",
"t": "meta@public-inbox.org"
}, {
...
next reply other threads:[~2021-01-05 9:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 9:56 Eric Wong [this message]
2021-01-06 0:00 ` JSON field names in terminal/pager output Kyle Meyer
2021-01-06 10:27 ` 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=20210105095646.GA26897@dcvr \
--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).