Re: Hi all
[notmuch-archives.git] / d2 / b55d044812702c69eed74f502ad615b6801fad
1 Return-Path: <jrollins@finestructure.net>\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 8EBD2431FAE\r
6         for <notmuch@notmuchmail.org>; Mon,  8 Feb 2010 09:24:27 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -4.031\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-4.031 tagged_above=-999 required=5 tests=[AWL=0.154,\r
12         BAYES_40=-0.185, RCVD_IN_DNSWL_MED=-4] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id FfrLSmler6gJ for <notmuch@notmuchmail.org>;\r
16         Mon,  8 Feb 2010 09:24:26 -0800 (PST)\r
17 Received: from serrano.cc.columbia.edu (serrano.cc.columbia.edu [128.59.29.6])\r
18         by olra.theworths.org (Postfix) with ESMTP id D2B85431FBD\r
19         for <notmuch@notmuchmail.org>; Mon,  8 Feb 2010 09:24:26 -0800 (PST)\r
20 Received: from servo.finestructure.net (geco.phys.columbia.edu\r
21         [128.59.170.159])\r
22         (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0)\r
23         by serrano.cc.columbia.edu (8.14.3/8.14.3) with ESMTP id o18HOPfA000890\r
24         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
25         Mon, 8 Feb 2010 12:24:25 -0500 (EST)\r
26 Received: from jrollins by servo.finestructure.net with local (Exim 4.71)\r
27         (envelope-from <jrollins@finestructure.net>)\r
28         id 1NeXLF-0004Vh-Je; Mon, 08 Feb 2010 12:24:09 -0500\r
29 From: Jameson Rollins <jrollins@finestructure.net>\r
30 To: Olly Betts <olly@survex.com>, notmuch@notmuchmail.org\r
31 In-Reply-To: <slrnhmpbhk.4kj.olly@msgid.survex.com>\r
32 References: <87636bws2o.fsf@servo.finestructure.net>\r
33         <slrnhmpbhk.4kj.olly@msgid.survex.com>\r
34 Date: Mon, 08 Feb 2010 12:24:06 -0500\r
35 Message-ID: <87hbpr8wuh.fsf@servo.finestructure.net>\r
36 MIME-Version: 1.0\r
37 Content-Type: multipart/signed; boundary="=-=-=";\r
38         micalg=pgp-sha256; protocol="application/pgp-signature"\r
39 X-No-Spam-Score: Local\r
40 X-Scanned-By: MIMEDefang 2.68 on 128.59.29.6\r
41 Subject: Re: [notmuch] strange behavior of indexing of and searching for\r
42  strings containing '[]'\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Mon, 08 Feb 2010 17:24:27 -0000\r
56 \r
57 --=-=-=\r
58 Content-Transfer-Encoding: quoted-printable\r
59 \r
60 On Fri, 5 Feb 2010 23:48:03 +0000 (UTC), Olly Betts <olly@survex.com> wrote:\r
61 > On 2010-02-05, Jameson Rollins wrote:\r
62 > > Hey, folks.  I've been noticing some strange behavior of notmuch search\r
63 > > results for strings containing '[]'.  Here are some searches for some\r
64 > > exact strings in messages subjects:\r
65 >=20\r
66 > The '[]' is a red herring.  Xapian's TermGenerator and QueryParser classes\r
67 > treat these two characters pretty much as if they were spaces.\r
68 \r
69 Ah.  Thanks for the response, Olly.  This clears things up a lot.\r
70 \r
71 > > servo:~ 0$ notmuch search subject:'emacs paned UI'\r
72 >=20\r
73 > Note that the '' is quoting for the shell only here.  So Xapian sees:\r
74 >=20\r
75 >     subject:emacs paned UI\r
76 >=20\r
77 > Assuming you are defaulting to an AND search, that's `emacs in the subjec=\r
78 t'\r
79 > AND `paned anywhere in the indexed text' AND `UI anywhere in the indexed =\r
80 text'.\r
81 \r
82 I don't think that this is exactly correct.  The quoting is interpreted\r
83 by the shell in order to construct a single string that is then passed\r
84 as an argument to the program.  Notmuch should then be seeing the single\r
85 string argument as the search parameter, and not breaking it up further.\r
86 \r
87 Here's an example of what I mean:\r
88 \r
89 servo:~/tmp/cdtemp.AYroUf 0$ cat parse=20\r
90 #!/bin/bash\r
91 for arg; do echo "$arg"; done\r
92 servo:~/tmp/cdtemp.AYroUf 0$ ./parse subject:foo bar baz\r
93 subject:foo\r
94 bar\r
95 baz\r
96 servo:~/tmp/cdtemp.AYroUf 0$ ./parse subject:'foo bar' baz\r
97 subject:foo bar\r
98 baz\r
99 servo:~/tmp/cdtemp.AYroUf 0$ ./parse subject:"foo bar" baz\r
100 subject:foo bar\r
101 baz\r
102 servo:~/tmp/cdtemp.AYroUf 0$=20\r
103 \r
104 As you can see in the last command, the argument "subject'foo bar'" is\r
105 passed as a single string by the shell, and should therefore be\r
106 interpreted as such by notmuch.\r
107 \r
108 jamie.\r
109 \r
110 --=-=-=\r
111 Content-Type: application/pgp-signature\r
112 \r
113 -----BEGIN PGP SIGNATURE-----\r
114 Version: GnuPG v1.4.10 (GNU/Linux)\r
115 \r
116 iQIcBAEBCAAGBQJLcEi2AAoJEO00zqvie6q8Ts0QALDzOV3qi+Qp/ArYZBzRae1u\r
117 MG5F3c1GehXI9gQWtGNvNPvsESD1+ymfVKlRb24yqdreuNNG+IINvRRAgci0mqZL\r
118 6nsbQREoozjlvpDYmnpjSDQz7tu/O0A/qAnRcAjjyzzzRkFgZxBa3+Tz94hJjKO8\r
119 HMZuoUikeTWxjxZ69kVA9NDL18LXFG9RUufctucmaLZdwrh1bG0owEeuU80EsfaX\r
120 Rl8o5widnAjzb+lfIZCQj6NTTpQOget7AXE/2JYV1raY1IlAfejoLjKW7j6wwqmA\r
121 vZfIgS6MfFWUs3ikYSyl1Toujnt/tFUmOLJTusYxRoH2sqZVfNBVjLFiYsGrqhyW\r
122 Jsnq0jfAYPeNM5rP/+aMBaFxI/TCgx7i3oQXhcHKwGUW6gebrosiyNr94ewYfeNZ\r
123 cC11qjjqQgXs8XF6+YiZv/aQS/n+GRYU5IvTaCfCrfdWWdnbImLxRp74q9EzlB7i\r
124 5gx9CnDthxovdrR8dH2PWgnUYl9nbBMsIqglvXid4MLHMTs8CqSHSjgF22g/1+28\r
125 wi3lu6h+KtqcMKcgF0cIh8SKoEFDkjcCc9E4THXRx4JjhoO/0Embkv9UkKVyOfZH\r
126 IU/KCTyATikkLRC2ffYNZ3bIyxVkDAQqg1+N+nO3QTb6CRlvx3TT+jZ9Qmz3qqj9\r
127 Zf2inTrn17ZXtvHwfYt1\r
128 =6eE7\r
129 -----END PGP SIGNATURE-----\r
130 --=-=-=--\r