From: Jani Nikula <jani@nikula.org>
To: "Robert Künnemann" <robert@kunnemann.de>, notmuch@notmuchmail.org
Subject: Re: Syntactic sugar for range syntax
Date: Thu, 11 Jun 2015 20:24:36 +0300 [thread overview]
Message-ID: <87h9qejgyz.fsf@nikula.org> (raw)
In-Reply-To: <20150610153833.GA19301@peachum.local>
On Wed, 10 Jun 2015, Robert Künnemann <robert@kunnemann.de> wrote:
> I've been using notmuch for about a year now (using mutt-kz) and I am
> very happy with it. I have, however, a small suggestion about the range
> syntax in search queries. Often, I am looking for emails that have
> occurred, say, in the last week. The query has the following form:
>
> date:today-1week..today
In other words, date:1w..
The reference for relative dates is "now" if one is not specified. The
minus sign means nothing, relative dates all refer to the past and are
added together.
> The following syntactic sugar could shorten this kind of queries:
>
> date:r -> date:r..today, if r is a relative date
You can use open ended queries date:since.. or date:..until to not limit
the end or start time.
> date:a -> date:a..a, if a is an absolute date
This needs support from Xapian, but we've discussed this in the past and
agree on the semantics. There's a patch to make date:a..! mean the same
in the mean time:
http://mid.gmane.org/1425732959-2282-1-git-send-email-jani@nikula.org
> date:a-r -> date:a-r..a, for combination.
I think this conflicts with the above.
> (If r is interpreted as today-r, the first two transformations are
> subsumed by the last.)
>
> For example:
> date:today -> date:today..today
> date:-1week -> date:-1week..today
date:1w..
> date:24.12.2014-4w -> date:24.12.2014-4w..24.12.2014
>
> What do you think about this suggestion? Is this something notmuch would
> do, or rather something for xapian?
What we can do in notmuch is pretty limited unless we write a full blown
custom query parser. Basically Xapian parses date: and .., and passes us
the rest to figure out.
HTH,
Jani.
>
> With kind regards, Robert Künnemann
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
next prev parent reply other threads:[~2015-06-11 17:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 15:38 Syntactic sugar for range syntax Robert Künnemann
2015-06-11 17:24 ` Jani Nikula [this message]
2015-06-13 9:33 ` Robert Künnemann
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://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h9qejgyz.fsf@nikula.org \
--to=jani@nikula.org \
--cc=notmuch@notmuchmail.org \
--cc=robert@kunnemann.de \
/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.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
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).