Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 92306431FBC for ; Mon, 1 Oct 2012 05:16:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rvHzs0Zyrblc for ; Mon, 1 Oct 2012 05:16:30 -0700 (PDT) Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU [18.7.68.36]) by olra.theworths.org (Postfix) with ESMTP id DBC96431FAE for ; Mon, 1 Oct 2012 05:16:29 -0700 (PDT) X-AuditID: 12074424-b7fce6d000000925-ec-5069899c285d Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP id D8.7C.02341.C9989605; Mon, 1 Oct 2012 08:16:28 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q91CGSkX018535; Mon, 1 Oct 2012 08:16:28 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q91CGQME007795 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 1 Oct 2012 08:16:27 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1TIevB-0004YG-Ut; Mon, 01 Oct 2012 08:16:25 -0400 Date: Mon, 1 Oct 2012 08:16:25 -0400 From: Austin Clements To: Damien Cassou Subject: Re: Searching from a folder Message-ID: <20121001121625.GD26662@mit.edu> References: <20120929161158.GX26662@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmplleLIzCtJLcpLzFFi42IR4hTV1p3TmRlg0N5gY7Hr7lYmi+s3ZzI7 MHnsnHWX3ePZqlvMAUxRXDYpqTmZZalF+nYJXBlrz81nKtjOXbGmvYGpgXE3ZxcjJ4eEgInE lPWvmCFsMYkL99azdTFycQgJ7GOU+HB4KSuEs55RYnbXUxYI5wSTxN3/95ghnCWMEtcmHwTr ZxFQkVg34TOYzSagIbFt/3JGEFtEQFvizdIOVhCbWUBa4tvvZiYQWxiofsubQ2BxXgEdieWH e6DW7WKUmLmymwkiIShxcuYTFohmLYkb/14CxTnABi3/xwES5hQIlLjS8Q5sjijQzCknt7FN YBSahaR7FpLuWQjdCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFuma6+VmluilppRuYgSFNruL yg7G5kNKhxgFOBiVeHgXXM4IEGJNLCuuzD3EKMnBpCTKu6stM0CILyk/pTIjsTgjvqg0J7X4 EKMEB7OSCK99DlCONyWxsiq1KB8mJc3BoiTOez3lpr+QQHpiSWp2ampBahFMVoaDQ0mCd3kH UKNgUWp6akVaZk4JQpqJgxNkOA/Q8LkgNbzFBYm5xZnpEPlTjIpS4rzNIAkBkERGaR5cLyz1 vGIUB3pFmLcJpIoHmLbgul8BDWYCGly1Kg1kcEkiQkqqgZG123r26+KG2Vyb9n1Q7bilv8vY ybqc8UnpbHsj/a2TxIT3mh/g2Omp8fjLjXy/qAf3e3gMRcVNz70NfW1n0++24DyLcMu5TY53 /tyK8KkUaLp2XUx9Tz//Wu+57gV3SiLVd7/5+DB98paAEKltGp+VPryuqpuytWJmdfSet9uO PJY5O/2pR4cSS3FGoqEWc1FxIgBENzcRGAMAAA== Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 01 Oct 2012 12:16:32 -0000 Quoth Damien Cassou on Oct 01 at 11:42 am: > On Sat, Sep 29, 2012 at 6:12 PM, Austin Clements wrote: > > $ notmuch search 'folder:"[Gmail].All Mail"' > > $ notmuch search 'folder:"[Gmail].Important"' > > thank you very much, it indeed works. I'm still a bit puzzled by the > fact that, on my other mailbox, I'm getting the following results: > > $ notmuch search 'folder:"[Gmail].Important"' | wc --lines > 8928 > $ notmuch search folder:[Gmail].Important | wc --lines > 138 > > So, without using quoting, something is indeed happening. Do you know what? In the latter case, you're finding emails that contain the words "folder" (or words like folder), "gmail", and "important". $ NOTMUCH_DEBUG_QUERY=1 notmuch search 'folder:"[Gmail].Important"' Final query is: Xapian::Query((Tmail AND (XFOLDERgmail:(pos=1) PHRASE 2 XFOLDERimportant:(pos=2)))) This is slightly inscrutable, but you can see that it applied the folder prefix ("XFOLDER") to both "gmail" and "important" and required that the two terms appear in a phrase (that is, next to each other). $ NOTMUCH_DEBUG_QUERY=1 notmuch search 'folder:[Gmail].Important' Final query is: Xapian::Query((Tmail AND Zfolder:(pos=1) AND gmail:(pos=2) AND important:(pos=3))) Whereas here, it's searching for folder, gmail, and important as regular and completely independent terms (the Z on folder means it's stemmed, so it will match folders, foldered, etc.)