From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E80146DE0C45 for ; Fri, 9 Jun 2017 16:18:13 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vObCpe5Qi0mr for ; Fri, 9 Jun 2017 16:18:13 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 072BF6DE0C19 for ; Fri, 9 Jun 2017 16:18:12 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dJT9R-0007oU-OG; Fri, 09 Jun 2017 19:17:09 -0400 Received: (nullmailer pid 9455 invoked by uid 1000); Fri, 09 Jun 2017 23:18:07 -0000 From: David Bremner To: Ioan-Adrian Ratiu , notmuch@notmuchmail.org Subject: Re: [PATCH v2 02/11] lib: database: store message filesize & add range processor In-Reply-To: <20170518222708.30032-3-adi@adirat.com> References: <20170518222708.30032-1-adi@adirat.com> <20170518222708.30032-3-adi@adirat.com> Date: Fri, 09 Jun 2017 20:18:07 -0300 Message-ID: <87a85geonk.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jun 2017 23:18:14 -0000 Ioan-Adrian Ratiu writes: > The filesize and range processor are very useful to do search queries > like "filesize:1000..10000". All sizes are in bytes for now because > that's what I'm interested in. Some points to mention in the commit message - you're adding a term prefix (although as discussed in the previous message, and below, I don't think you want to be) - you're extending the query language. - it's fine that all sizes are in bytes, but the main point is not your motivation but that it can be extended to other units in the future by preprocessing the query. > > I think the database needs to be re-created for this to work so that > all newly indexed messages have the new xapian filesize value, I did > not have the time to test a "hybrid" database where just some of the > messages have the value. see commit 0de999aab5bd4cd44bc4ea76fd1d25172bd839ae for how to handle this. After this commit, you have enough new features to test indexing and searching by file size, so please do, in particular testing the case you mention above. The new syntax should work with e.g. "notmuch search" and "notmuch show". > > + { "filesize", "XFILESIZE", NOTMUCH_FIELD_EXTERNAL }, > }; This is a bit subtle, but I don't think you should add filesize to this table (compare with "lastmod").