[PATCH v3 6/9] lib: add date range query support
Michal Nazarewicz
mina86 at mina86.com
Mon Sep 17 08:03:59 PDT 2012
> Michal Nazarewicz <mina86 at mina86.com> writes:
>> IMO this is totally unintuitive and not how the range should work.
>> date:foo..bar should return messages whose date >= foo and < bar. So
>> for instance date:november..yesterday should return messages whose date
>> is > 2012/11/01 00:00:00 and < 2012/09/12 00:00:00. So to get
>> yesterdays messages one would do: date:yesterday..today.
On Thu, Sep 13 2012, David Bremner wrote:
> I don't find ranges being half-open by default to be very
> intuitive. Perhaps I don't program in python enough.
Perhaps C than: “for (i = 0; i < 10; ++i)” is the standard idiom and the
end range is open.
Let's take a look at:
date:2012/01/01..2012/01/01 + 1 day
in my opinion, that should give results from the first of January only,
since “+ 1 day” indicates in a way how long user want the period to be.
I think it's also easier to pragmatically create ranges. For instance,
let's say you want to create ranges for each week, you'd end up with:
date:2012/01/02..2012/01/09 ## 2012w01
date:2012/01/09..2012/01/16 ## 2012w02
date:2012/01/16..2012/01/23 ## 2012w03
Notice how the opening date of a range matches the closing date of
the previous date.
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michał “mina86” Nazarewicz (o o)
ooo +----<email/xmpp: mpn at google.com>--------------ooO--(_)--Ooo--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20120917/8fbb08b7/attachment.pgp>
More information about the notmuch
mailing list