From 6c9195771bdf311fab471708b434b51ab8d61998 Mon Sep 17 00:00:00 2001 From: Suvayu Ali Date: Tue, 29 Sep 2015 09:15:18 +0200 Subject: [PATCH] Re: correct way to search for only PDF attachments --- a2/498d797baa308ee1f0c2fcab56f523a787af81 | 112 ++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 a2/498d797baa308ee1f0c2fcab56f523a787af81 diff --git a/a2/498d797baa308ee1f0c2fcab56f523a787af81 b/a2/498d797baa308ee1f0c2fcab56f523a787af81 new file mode 100644 index 000000000..e49433105 --- /dev/null +++ b/a2/498d797baa308ee1f0c2fcab56f523a787af81 @@ -0,0 +1,112 @@ +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 595096DE0274 + for ; Tue, 29 Sep 2015 00:15:27 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.719 +X-Spam-Level: +X-Spam-Status: No, score=-0.719 tagged_above=-999 required=5 tests=[AWL=0.101, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, + SPF_PASS=-0.001] 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 Y8xi7JBXOqhb for ; + Tue, 29 Sep 2015 00:15:25 -0700 (PDT) +Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com + [209.85.212.177]) + by arlo.cworth.org (Postfix) with ESMTPS id 47A216DE00CB + for ; Tue, 29 Sep 2015 00:15:25 -0700 (PDT) +Received: by wicfx3 with SMTP id fx3so136025187wic.1 + for ; Tue, 29 Sep 2015 00:15:22 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=sender:date:from:to:subject:message-id:mail-followup-to:references + :mime-version:content-type:content-disposition:in-reply-to + :user-agent; bh=eGQWYUoy7Osa2KtLHD54YHVpJOBd98yZKjj/F6Zq010=; + b=vdchQKPQGZ4UyLWrcBcWKTbSf0eXs9knLPXFfEuo71/JuefB6qGnlZsLIG8zp09Cdl + eYHgKRLNrYUXYQs4Vmx8Gfb415HFW6XJUeKDgdtVs4SiSh+atJv/IfXg5m3F2cK/Iob6 + w7zCILnzYNRJQygV+dDqATdWbNhUJexNsnidbrQ8BYsH6MwYEGVkNXwyGrp2o8SIK6WP + Wuyzn9nDxF4OmLsSERl3SV5qD3YaqwB+MoRXYIc+1BNr98CRFxK2HWAJRkCH3i78E6km + vpZaeKrMOr8ROG6HE/E9hepP9167n9Q2Fk7MZO2MyqtKhSdNDrmAFwtxiNgH1ahuo/GM + i0Sw== +X-Received: by 10.180.188.211 with SMTP id gc19mr24815441wic.81.1443510921969; + Tue, 29 Sep 2015 00:15:21 -0700 (PDT) +Received: from chitra.no-ip.org (5072840E.static.ziggozakelijk.nl. + [80.114.132.14]) + by smtp.gmail.com with ESMTPSA id r4sm22181632wia.19.2015.09.29.00.15.20 + for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Tue, 29 Sep 2015 00:15:20 -0700 (PDT) +Sender: Suvayu Ali +Date: Tue, 29 Sep 2015 09:15:18 +0200 +From: Suvayu Ali +To: notmuch@notmuchmail.org +Subject: Re: correct way to search for only PDF attachments +Message-ID: <20150929071518.GA20628@chitra.no-ip.org> +Mail-Followup-To: notmuch@notmuchmail.org +References: + + <87vbau9e8i.fsf@wondoo.home.cworth.org> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <87vbau9e8i.fsf@wondoo.home.cworth.org> +User-Agent: Mutt/1.5.23.1 (2014-03-12) +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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, 29 Sep 2015 07:15:27 -0000 + +On Mon, Sep 28, 2015 at 07:00:13PM -0700, Carl Worth wrote: +> On Mon, Sep 28 2015, Xu Wang wrote: +> +> > To understand more, what does the following search for? +> > +> > from:jongho attachment:.*pdf +> +> Uhm, probably only strange things. There are some mechanisms for getting +> notmuch to emit some debugging information on what the final search +> terms end up being, (but I don't recall if they still require +> recompilation or not). + +This should work: + + $ export NOTMUCH_DEBUG_QUERY=1 + $ notmuch count -- from:suvayu attachment:*.pdf + Query string is: + from:suvayu attachment:*.pdf + Exclude query is: + Xapian::Query() + Final query is: + Xapian::Query((Tmail AND ZXFROMsuvayu:(pos=1) AND Zattach:(pos=2) AND Zpdf:(pos=3))) + 217 + $ notmuch count -- from:suvayu attachment:pdf + Query string is: + from:suvayu attachment:pdf + Exclude query is: + Xapian::Query() + Final query is: + Xapian::Query((Tmail AND ZXFROMsuvayu:(pos=1) AND ZXATTACHMENTpdf:(pos=2))) + 151 + +I guess to answer the OP's question, the globbed form simply does a text +search of attach and pdf. The keyword is not recognised at all. + +Cheers, + +-- +Suvayu + +Open source is the future. It sets us free. -- 2.26.2