Re: [PATCH v3 6/9] lib: add date range query support

Subject: Re: [PATCH v3 6/9] lib: add date range query support

Date: Thu, 13 Sep 2012 14:32:30 +0300

To: Michal Nazarewicz, Jani Nikula, notmuch@notmuchmail.org, David Bremner

Cc:

From: Tomi Ollila


On Thu, Sep 13 2012, Michal Nazarewicz <mina86@mina86.com> wrote:

> On Wed, Sep 12 2012, Jani Nikula wrote:
>> Add a custom value range processor to enable date and time searches of
>> the form date:since..until, where "since" and "until" are expressions
>> understood by the previously added date/time parser, to restrict the
>> results to messages within a particular time range (based on the Date:
>> header).
>>
>> If "since" or "until" describes date/time at an accuracy of days or
>> less, the values are rounded according to the accuracy, towards past
>> for "since" and towards future for "until". For example,
>> date:november..yesterday would match from the beginning of November
>> until the end of yesterday. Expressions such as date:today..today
>> means since the beginning of today until the end of today.
>
> 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.


I find yesterday..yesterday to return whole yesterday's messages more
intuitive than that returning zero messages and requiring yesterday..today
to see messages sent yesterday. However, I've noticed that range
described as -1day..-1day (if that syntax is/were supported)
that would be a bit confusing (In yesterday's case I think the length
of 'yesterday' is 24h, but in '-1day' the lenght is one second
(or something))

Anyway, this just emphasizes that this is confusing matter; we need
a good idiom to comprehend this issue...

Tomi


>
>> Open-ended ranges are supported (since Xapian 1.2.1), i.e. you can
>> specify date:..until or date:since.. to not limit the start or end
>> date, respectively.
>>
>> CAVEATS:
>>
>> Xapian does not support spaces in range expressions. You can replace
>> the spaces with '_', or (in most cases) '-', or (in some cases) leave
>> the spaces out altogether.
>
> -- 
> Best regards,                                         _     _
> .o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
> ..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
> ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--_______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

Thread: