Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 8EBD2431FAE for ; Mon, 8 Feb 2010 09:24:27 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -4.031 X-Spam-Level: X-Spam-Status: No, score=-4.031 tagged_above=-999 required=5 tests=[AWL=0.154, BAYES_40=-0.185, RCVD_IN_DNSWL_MED=-4] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FfrLSmler6gJ for ; Mon, 8 Feb 2010 09:24:26 -0800 (PST) Received: from serrano.cc.columbia.edu (serrano.cc.columbia.edu [128.59.29.6]) by olra.theworths.org (Postfix) with ESMTP id D2B85431FBD for ; Mon, 8 Feb 2010 09:24:26 -0800 (PST) Received: from servo.finestructure.net (geco.phys.columbia.edu [128.59.170.159]) (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0) by serrano.cc.columbia.edu (8.14.3/8.14.3) with ESMTP id o18HOPfA000890 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 8 Feb 2010 12:24:25 -0500 (EST) Received: from jrollins by servo.finestructure.net with local (Exim 4.71) (envelope-from ) id 1NeXLF-0004Vh-Je; Mon, 08 Feb 2010 12:24:09 -0500 From: Jameson Rollins To: Olly Betts , notmuch@notmuchmail.org In-Reply-To: References: <87636bws2o.fsf@servo.finestructure.net> Date: Mon, 08 Feb 2010 12:24:06 -0500 Message-ID: <87hbpr8wuh.fsf@servo.finestructure.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.68 on 128.59.29.6 Subject: Re: [notmuch] strange behavior of indexing of and searching for strings containing '[]' X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 08 Feb 2010 17:24:27 -0000 --=-=-= Content-Transfer-Encoding: quoted-printable On Fri, 5 Feb 2010 23:48:03 +0000 (UTC), Olly Betts wrote: > On 2010-02-05, Jameson Rollins wrote: > > Hey, folks. I've been noticing some strange behavior of notmuch search > > results for strings containing '[]'. Here are some searches for some > > exact strings in messages subjects: >=20 > The '[]' is a red herring. Xapian's TermGenerator and QueryParser classes > treat these two characters pretty much as if they were spaces. Ah. Thanks for the response, Olly. This clears things up a lot. > > servo:~ 0$ notmuch search subject:'emacs paned UI' >=20 > Note that the '' is quoting for the shell only here. So Xapian sees: >=20 > subject:emacs paned UI >=20 > Assuming you are defaulting to an AND search, that's `emacs in the subjec= t' > AND `paned anywhere in the indexed text' AND `UI anywhere in the indexed = text'. I don't think that this is exactly correct. The quoting is interpreted by the shell in order to construct a single string that is then passed as an argument to the program. Notmuch should then be seeing the single string argument as the search parameter, and not breaking it up further. Here's an example of what I mean: servo:~/tmp/cdtemp.AYroUf 0$ cat parse=20 #!/bin/bash for arg; do echo "$arg"; done servo:~/tmp/cdtemp.AYroUf 0$ ./parse subject:foo bar baz subject:foo bar baz servo:~/tmp/cdtemp.AYroUf 0$ ./parse subject:'foo bar' baz subject:foo bar baz servo:~/tmp/cdtemp.AYroUf 0$ ./parse subject:"foo bar" baz subject:foo bar baz servo:~/tmp/cdtemp.AYroUf 0$=20 As you can see in the last command, the argument "subject'foo bar'" is passed as a single string by the shell, and should therefore be interpreted as such by notmuch. jamie. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBCAAGBQJLcEi2AAoJEO00zqvie6q8Ts0QALDzOV3qi+Qp/ArYZBzRae1u MG5F3c1GehXI9gQWtGNvNPvsESD1+ymfVKlRb24yqdreuNNG+IINvRRAgci0mqZL 6nsbQREoozjlvpDYmnpjSDQz7tu/O0A/qAnRcAjjyzzzRkFgZxBa3+Tz94hJjKO8 HMZuoUikeTWxjxZ69kVA9NDL18LXFG9RUufctucmaLZdwrh1bG0owEeuU80EsfaX Rl8o5widnAjzb+lfIZCQj6NTTpQOget7AXE/2JYV1raY1IlAfejoLjKW7j6wwqmA vZfIgS6MfFWUs3ikYSyl1Toujnt/tFUmOLJTusYxRoH2sqZVfNBVjLFiYsGrqhyW Jsnq0jfAYPeNM5rP/+aMBaFxI/TCgx7i3oQXhcHKwGUW6gebrosiyNr94ewYfeNZ cC11qjjqQgXs8XF6+YiZv/aQS/n+GRYU5IvTaCfCrfdWWdnbImLxRp74q9EzlB7i 5gx9CnDthxovdrR8dH2PWgnUYl9nbBMsIqglvXid4MLHMTs8CqSHSjgF22g/1+28 wi3lu6h+KtqcMKcgF0cIh8SKoEFDkjcCc9E4THXRx4JjhoO/0Embkv9UkKVyOfZH IU/KCTyATikkLRC2ffYNZ3bIyxVkDAQqg1+N+nO3QTb6CRlvx3TT+jZ9Qmz3qqj9 Zf2inTrn17ZXtvHwfYt1 =6eE7 -----END PGP SIGNATURE----- --=-=-=--