--- /dev/null
+Return-Path: <xuwang762@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id E19DC6DE0A7F\r
+ for <notmuch@notmuchmail.org>; Mon, 28 Sep 2015 21:51:05 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.523\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.523 tagged_above=-999 required=5 tests=[AWL=0.047,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 28DnPa_fmzmN for <notmuch@notmuchmail.org>;\r
+ Mon, 28 Sep 2015 21:51:03 -0700 (PDT)\r
+Received: from mail-ob0-f196.google.com (mail-ob0-f196.google.com\r
+ [209.85.214.196])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 0B46A6DE0274\r
+ for <notmuch@notmuchmail.org>; Mon, 28 Sep 2015 21:51:03 -0700 (PDT)\r
+Received: by obczc1 with SMTP id zc1so2128774obc.3\r
+ for <notmuch@notmuchmail.org>; Mon, 28 Sep 2015 21:51:02 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
+ :cc:content-type;\r
+ bh=3/hUH2KXcFihYxx+QXvvPTSSotEVHReXOmmc0xAoAhI=;\r
+ b=FVm06jCA7VonwRUhAgi8PksthWpTWDbEb1XcW6QV4nk62SPxN9K+u1qMmvKrGWidkX\r
+ VW5lu1ox2Hsh4RzybkNBQM5l/LQ4/FM7KXbDjhO3N9OpsMqv0A3yds9xnEJpPmOSKkr0\r
+ ndf+HoCqWd1GX2pYx0E5P90XYaJciz279CWbTVo9hNX8mUg2mTgpyPjma4uQYT3ybiHC\r
+ DM7Dbq11j30TxF4kGpCS+cHc+hwzJPhc0lX3eGkwA0uIi1Z8EZG0A/X5kVVXi7y9HZf7\r
+ TFXanK/oy1DzfINJWvvIMljl2KdzoM4TvzuxwluJro36nP7d6lhLUOX1X3mgt3XgpiUj\r
+ tadg==\r
+MIME-Version: 1.0\r
+X-Received: by 10.182.138.40 with SMTP id qn8mr99812obb.78.1443502262004; Mon,\r
+ 28 Sep 2015 21:51:02 -0700 (PDT)\r
+Received: by 10.202.212.204 with HTTP; Mon, 28 Sep 2015 21:51:01 -0700 (PDT)\r
+In-Reply-To: <87vbau9e8i.fsf@wondoo.home.cworth.org>\r
+References:\r
+ <CAJhTkNgwX8cmsKfJGV+x7HHMXPNZvXFXO=KZzLvrcWCGrDL=Pg@mail.gmail.com>\r
+ <87vbau9e8i.fsf@wondoo.home.cworth.org>\r
+Date: Tue, 29 Sep 2015 00:51:01 -0400\r
+Message-ID:\r
+ <CAJhTkNg0_j3R8zdpywmZkreFU2p+Wky8oxC7vvuQYzNK2U=-1Q@mail.gmail.com>\r
+Subject: Re: correct way to search for only PDF attachments\r
+From: Xu Wang <xuwang762@gmail.com>\r
+To: Carl Worth <cworth@cworth.org>\r
+Content-Type: text/plain; charset=UTF-8\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Tue, 29 Sep 2015 04:51:06 -0000\r
+\r
+On Mon, Sep 28, 2015 at 10:00 PM, Carl Worth <cworth@cworth.org> wrote:\r
+> On Mon, Sep 28 2015, Xu Wang wrote:\r
+>> I would look to look for all emails from a colleague jongho. I tried:\r
+>>\r
+>> from:jongho attachment:pdf\r
+>>\r
+>> which seems to do as I wanted.\r
+>\r
+> Good. That should work.\r
+>\r
+>> To understand more, what does the following search for?\r
+>>\r
+>> from:jongho attachment:.*pdf\r
+>\r
+> Uhm, probably only strange things. There are some mechanisms for getting\r
+> notmuch to emit some debugging information on what the final search\r
+> terms end up being, (but I don't recall if they still require\r
+> recompilation or not).\r
+>\r
+> I'm not testing now, but I wouldn't be surprised if that ended up doing\r
+> something like searching for a phrase like "attachment pdf" anywhere\r
+> within a message. (The Xapian parser can be somewhat unpredictable when\r
+> you give it unexpected input.)\r
+>\r
+>> Also, how does the first one above know that I want only PDF\r
+>> attachments and not an attachment called "pdformula.txt" ?\r
+>\r
+> It doesn't know that you want only PDF attachments. The key part is that\r
+> the indexing is performed by breaking text up into individual terms, (at\r
+> punctuation boundaries usually). So a search specification like\r
+> "attachment:pdf" is searching for things that were indexed with the\r
+> "pdf" term within the attachment prefix. So that won't match a filename\r
+> like pdformula.txt, (which would be indexed as two terms, "pdformula"\r
+> and "txt"), but it would match pdf.ormula.txt, (which would be indexed\r
+> as three terms, "pdf", "ormula" and "txt").\r
+>\r
+> The Xapian documentation can be examined if you want more details.\r
+\r
+This is highly useful. Thank for such an explanation!! Thank you, Carl.\r
+\r
+Kind regards,\r
+\r
+Xu\r