* Syntactic sugar for range syntax
@ 2015-06-10 15:38 Robert Künnemann
2015-06-11 17:24 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Robert Künnemann @ 2015-06-10 15:38 UTC (permalink / raw)
To: notmuch
Hi everyone,
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
The following syntactic sugar could shorten this kind of queries:
date:r -> date:r..today, if r is a relative date
date:a -> date:a..a, if a is an absolute date
date:a-r -> date:a-r..a, for combination.
(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: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?
With kind regards, Robert Künnemann
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Syntactic sugar for range syntax
2015-06-10 15:38 Syntactic sugar for range syntax Robert Künnemann
@ 2015-06-11 17:24 ` Jani Nikula
2015-06-13 9:33 ` Robert Künnemann
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2015-06-11 17:24 UTC (permalink / raw)
To: Robert Künnemann, notmuch
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Syntactic sugar for range syntax
2015-06-11 17:24 ` Jani Nikula
@ 2015-06-13 9:33 ` Robert Künnemann
0 siblings, 0 replies; 3+ messages in thread
From: Robert Künnemann @ 2015-06-13 9:33 UTC (permalink / raw)
To: Jani Nikula; +Cc: notmuch
Hi!
Thanks for your response!
On 11/06, Jani Nikula wrote:
>> 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.
That's good enough for my purposes. The man page could be a bit
clearer on that, I'll try to send a patch later.
With kind regards, Robert Künnemann
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-13 9:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 15:38 Syntactic sugar for range syntax Robert Künnemann
2015-06-11 17:24 ` Jani Nikula
2015-06-13 9:33 ` Robert Künnemann
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).