On Fri, 5 Feb 2010 23:48:03 +0000 (UTC), Olly Betts <o...@survex.com> 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: > > 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' > > Note that the '' is quoting for the shell only here. So Xapian sees: > > subject:emacs paned UI > > Assuming you are defaulting to an AND search, that's `emacs in the subject' > 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 #!/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$ 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.
pgpBHd8c9bE0Q.pgp
Description: PGP signature
_______________________________________________ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch