Re: [PATCH v3 6/9] lib: add date range query support
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 13 Sep 2012 11:32:30 +0000 (14:32 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:30 +0000 (09:49 -0800)
1e/a441c12f12a2fe248983a048aa5712e24e1cc4 [new file with mode: 0644]

diff --git a/1e/a441c12f12a2fe248983a048aa5712e24e1cc4 b/1e/a441c12f12a2fe248983a048aa5712e24e1cc4
new file mode 100644 (file)
index 0000000..eb75def
--- /dev/null
@@ -0,0 +1,112 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A5ED2431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 13 Sep 2012 04:32:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id B5skvmycRgoL for <notmuch@notmuchmail.org>;\r
+       Thu, 13 Sep 2012 04:32:25 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9F16B431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 13 Sep 2012 04:32:25 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 12FB010036F;\r
+       Thu, 13 Sep 2012 14:32:31 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Michal Nazarewicz <mina86@mina86.com>, Jani Nikula <jani@nikula.org>,\r
+       notmuch@notmuchmail.org, David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH v3 6/9] lib: add date range query support\r
+In-Reply-To: <xa1tsjamdvj6.fsf@mina86.com>\r
+References: <cover.1347484177.git.jani@nikula.org>\r
+       <532340d05ea748518c021048900bb83149e04e88.1347484177.git.jani@nikula.org>\r
+       <xa1tsjamdvj6.fsf@mina86.com>\r
+User-Agent: Notmuch/0.13.2+162~ged38330 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 13 Sep 2012 14:32:30 +0300\r
+Message-ID: <m2r4q6jgz5.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 13 Sep 2012 11:32:27 -0000\r
+\r
+On Thu, Sep 13 2012, Michal Nazarewicz <mina86@mina86.com> wrote:\r
+\r
+> On Wed, Sep 12 2012, Jani Nikula wrote:\r
+>> Add a custom value range processor to enable date and time searches of\r
+>> the form date:since..until, where "since" and "until" are expressions\r
+>> understood by the previously added date/time parser, to restrict the\r
+>> results to messages within a particular time range (based on the Date:\r
+>> header).\r
+>>\r
+>> If "since" or "until" describes date/time at an accuracy of days or\r
+>> less, the values are rounded according to the accuracy, towards past\r
+>> for "since" and towards future for "until". For example,\r
+>> date:november..yesterday would match from the beginning of November\r
+>> until the end of yesterday. Expressions such as date:today..today\r
+>> means since the beginning of today until the end of today.\r
+>\r
+> IMO this is totally unintuitive and not how the range should work.\r
+> date:foo..bar should return messages whose date >=3D foo and < bar.  So\r
+> for instance date:november..yesterday should return messages whose date\r
+> is > 2012/11/01 00:00:00 and < 2012/09/12 00:00:00.  So to get\r
+> yesterdays messages one would do: date:yesterday..today.\r
+\r
+\r
+I find yesterday..yesterday to return whole yesterday's messages more\r
+intuitive than that returning zero messages and requiring yesterday..today\r
+to see messages sent yesterday. However, I've noticed that range\r
+described as -1day..-1day (if that syntax is/were supported)\r
+that would be a bit confusing (In yesterday's case I think the length\r
+of 'yesterday' is 24h, but in '-1day' the lenght is one second\r
+(or something))\r
+\r
+Anyway, this just emphasizes that this is confusing matter; we need\r
+a good idiom to comprehend this issue...\r
+\r
+Tomi\r
+\r
+\r
+>\r
+>> Open-ended ranges are supported (since Xapian 1.2.1), i.e. you can\r
+>> specify date:..until or date:since.. to not limit the start or end\r
+>> date, respectively.\r
+>>\r
+>> CAVEATS:\r
+>>\r
+>> Xapian does not support spaces in range expressions. You can replace\r
+>> the spaces with '_', or (in most cases) '-', or (in some cases) leave\r
+>> the spaces out altogether.\r
+>\r
+> --=20\r
+> Best regards,                                         _     _\r
+> .o. | Liege of Serenely Enlightened Majesty of      o' \,=3D./ `o\r
+> ..o | Computer Science,  Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz =\r
+   (o o)\r
+> ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--_______=\r
+________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r