Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 878306DE00DA for ; Tue, 7 Jun 2016 03:16:49 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.011 X-Spam-Level: X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 tests=[AWL=-0.000, 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 q9H0-Ux0xJ0z for ; Tue, 7 Jun 2016 03:16:41 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id B07C76DE00D3 for ; Tue, 7 Jun 2016 03:16:41 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84) (envelope-from ) id 1bAE3V-00061n-9c; Tue, 07 Jun 2016 06:16:17 -0400 Received: (nullmailer pid 14467 invoked by uid 1000); Tue, 07 Jun 2016 10:16:27 -0000 From: David Bremner To: Austin Clements Cc: sfischme@uwaterloo.ca, Gaute Hope , notmuch Subject: Re: [PATCH] WIP: regexp matching in subjects In-Reply-To: <1465265149-7174-1-git-send-email-david@tethera.net> References: <1465265149-7174-1-git-send-email-david@tethera.net> User-Agent: Notmuch/0.22+28~gb9bf3f4 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Tue, 07 Jun 2016 07:16:27 -0300 Message-ID: <87ziqx9udg.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 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: Tue, 07 Jun 2016 10:16:49 -0000 David Bremner writes: > the idea is that you can run > > % notmuch search 'subject:rx:' > > or > > % notmuch search subject:"your usual phrase search" > > This should also work with bindings. > --- > > Here is Austin's "hack", crammed into the field processor framework. > I seem to have broken one of the existing subject search tests with my > recursive query parsing. I didn't have time to figure out why, yet. A few hours sleep and I think I understand the issue. with subject:"your usual phrase search" I believe the phrase-ness (word ordering and proximity) gets lost when using a field processor. So, since I don't know if/when this issue will be fixed in Xapian, we should probably use a seperate prefix for regexp search. This leads to two potential syntaxes subject_re:"^i am first" regexp:subject:"^i am first" If we did stick with the current syntax, one could use subject:your-usual-phrase-search to preserve phraseness. Note that for regexps with spaces in them, the required quoting is a bit counterintuitive ./notmuch count 'subject:"rx:Graduate Committee"' That's a consequence of my faking "sub-prefixes". Which seemed clever at the time, but maybe not. d