correct way to search for only PDF attachments

Suvayu Ali fatkasuvayu+linux at gmail.com
Tue Sep 29 00:15:18 PDT 2015


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.


More information about the notmuch mailing list