Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 23 / c12dbca5c2bdb59850bc356ddd4b3a330304af
1 Return-Path: <novalazy@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 981E8431FAF\r
6         for <notmuch@notmuchmail.org>; Mon, 28 May 2012 21:01:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id Cx36CJlgjtys for <notmuch@notmuchmail.org>;\r
17         Mon, 28 May 2012 21:01:28 -0700 (PDT)\r
18 Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com\r
19         [209.85.210.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 091D2431FAE\r
22         for <notmuch@notmuchmail.org>; Mon, 28 May 2012 21:01:27 -0700 (PDT)\r
23 Received: by dadg9 with SMTP id g9so6110644dad.26\r
24         for <notmuch@notmuchmail.org>; Mon, 28 May 2012 21:01:27 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26         h=date:message-id:from:to:subject:in-reply-to:references:mime-version\r
27         :content-type:content-disposition:content-transfer-encoding;\r
28         bh=21b9W+jHEHxZS+r1pho5OsN8/RG4/sy5YZWeLem0gss=;\r
29         b=RN0mUJehhUsvVDY1VIIhMd2wwIxtb5uQjE5zp05JW8K7wbmiK9cB71wEBxjHsDnRY6\r
30         MorAWwEdjSzWiOtR/aTTj8J2Fb6vjFh5xx2xBnZhV8lksSj8twlAoGfTmguF59fvtNT9\r
31         UysQHylmYGqqDcQ1Gz4FBrpccvWDwAkaZhc3SL4bvs5KmNDDqp7nsCGzQPw2ifNNDVTp\r
32         +sz7VWjRDFoYM4eWY4hykH6tzqHZnClefTjrMZVzXQ8k1sRI+kBDC3f/x5I0LD6+NTUx\r
33         lNKPcpafCbiJ5gZp8FkwQcir87j1h5PRe3bX21DI6ZuuwyTuZjE8ItMLc46YAyP9i05o\r
34         i5HA==\r
35 Received: by 10.68.138.161 with SMTP id qr1mr33849964pbb.37.1338264087065;\r
36         Mon, 28 May 2012 21:01:27 -0700 (PDT)\r
37 Received: from localhost (215.42.233.220.static.exetel.com.au.\r
38         [220.233.42.215])\r
39         by mx.google.com with ESMTPS id tj4sm21385720pbc.33.2012.05.28.21.01.22\r
40         (version=TLSv1/SSLv3 cipher=OTHER);\r
41         Mon, 28 May 2012 21:01:25 -0700 (PDT)\r
42 Date: Tue, 29 May 2012 14:01:07 +1000\r
43 Message-ID: <20120529140107.GE2347@hili.localdomain>\r
44 From: Peter Wang <novalazy@gmail.com>\r
45 To: notmuch@notmuchmail.org\r
46 Subject: Re: search summary and exclusions\r
47 In-Reply-To: <87mx4sp79z.fsf@servo.finestructure.net>\r
48 References: <20120529000012.GF2331@hili.localdomain>\r
49         <87mx4sp79z.fsf@servo.finestructure.net>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=utf-8\r
52 Content-Disposition: inline\r
53 Content-Transfer-Encoding: 8bit\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Tue, 29 May 2012 04:01:28 -0000\r
67 \r
68 On Mon, 28 May 2012 10:03:35 -0700, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
69 > On Mon, May 28 2012, Peter Wang <novalazy@gmail.com> wrote:\r
70 > > Exclusions don't work the way I expected with the search command and\r
71 > > --output=summary.  I would like messages with excluded tags to be\r
72 > > treated as if they don't exist at all, but currently:\r
73 > >\r
74 > >   * excluded messages are counted towards the "total"\r
75 > >   * excluded tags are included in the "tags" set\r
76 > >\r
77 > > Are these deliberate?  Especially the second point seems to conflict\r
78 > > with search --output=tags, which doesn't show excluded tags.\r
79\r
80 > Hi, Peter.  Can you explain more what you mean?  I'm not sure what your\r
81 > two bullets have to do with --output=summary.  Messages are counted with\r
82 > the count subcommand, and tags are shown with search --output=tags,\r
83 > neither of which have anything to do with --output=summary, and both of\r
84 > which accept the exclude flag:\r
85\r
86 > notmuch count --exclude=true '*'\r
87 > notmuch search --output=tags --exclude=true '*'\r
88\r
89 > Maybe you can give a clearer explanation of what your issue is.\r
90 > Examples help.\r
91 \r
92 Sure.  I keep draft messages in the mail store, and tag them with\r
93 'draft', and later 'deleted'.  I would like the exclusions to treat\r
94 draft and deleted messages as if they didn't exist in the store.\r
95 \r
96 % ./notmuch search --format=json --exclude=true -- thread:0000000000009598 tag:unread\r
97 [{"thread": "0000000000009598",\r
98 "timestamp": 1338231998,\r
99 "date_relative": "Today 05:06",\r
100 "matched": 1,\r
101 "total": 15,\r
102 "authors": "Mark Walters| Peter Wang",\r
103 "subject": "[PATCH v6 3/6] cli: make --entire-thread=false work for format=json.",\r
104 "tags": ["deleted", "draft", "replied", "sent", "unread"]}]\r
105 \r
106 Here is a thread I participated in.  From this, my MUA displays "1/15",\r
107 suggesting that there is 1 unread message out of a total of 15.  But\r
108 upon opening the thread, there are only 11 messages visible: 4 were\r
109 drafts (possibly deleted) which have been excluded.  To the user, it\r
110 looks like some messages went missing.\r
111 \r
112 Therefore I would like search --output=summary --exclude=true\r
113 to report the total number of non-excluded messages.  It doesn't need to\r
114 be via the "total" field; a new field would be fine.\r
115 \r
116 Peter\r