--- /dev/null
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id AF5D1431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 15 Mar 2012 19:11:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 5xr+mJtBwveB for <notmuch@notmuchmail.org>;\r
+ Thu, 15 Mar 2012 19:11:27 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU\r
+ [18.9.25.12])\r
+ by olra.theworths.org (Postfix) with ESMTP id C585E431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 15 Mar 2012 19:11:26 -0700 (PDT)\r
+X-AuditID: 1209190c-b7fad6d000000920-fc-4f62a14eb931\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 3E.92.02336.E41A26F4; Thu, 15 Mar 2012 22:11:26 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q2G2BPvW031757; \r
+ Thu, 15 Mar 2012 22:11:26 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2G2BOnR018316\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Thu, 15 Mar 2012 22:11:25 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1S8MdY-0001gz-4e; Thu, 15 Mar 2012 22:11:24 -0400\r
+Date: Thu, 15 Mar 2012 22:11:24 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Andrei POPESCU <andreimpopescu@gmail.com>\r
+Subject: Re: [RFC] http://notmuchmail.org/searching/ [was: Re: Improving\r
+ notmuch query documentation]\r
+Message-ID: <20120316021124.GD2670@mit.edu>\r
+References: <20120115220600.GO7037@think.nuvreauspam>\r
+ <877h0sa207.fsf@fester.com>\r
+ <20120116202103.GA14329@think.nuvreauspam>\r
+ <20120117023431.GF16740@mit.edu>\r
+ <20120117221435.GN3272@think.nuvreauspam>\r
+ <20120117222923.GU16740@mit.edu>\r
+ <20120315093941.GK2981@sid.nuvreauspam>\r
+ <20120315211107.GA2670@mit.edu>\r
+ <20120316003053.GR2981@sid.nuvreauspam>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <20120316003053.GR2981@sid.nuvreauspam>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFprAKsWRmVeSWpSXmKPExsUixG6nouu3MMnf4M8VHotVE6Qtrt+cyezA\r
+ 5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZdy5doS1YKJyxfLr85gbGLdJdzFyckgImEg8\r
+ aLzOCGGLSVy4t56ti5GLQ0hgH6PE+ffzWCGcDYwSN88vhHJOMklMnPQEylnCKNH5ZhsTSD+L\r
+ gKrEykv/2UBsNgENiW37l4PNFRHQleh8dQCshllAWuLb72YwW1ggXeLZhmlgNbwC2hLXuhYx\r
+ Qwx9wSTx9dl5FoiEoMTJmU9YIJq1JG78ewnUzAE2aPk/DpAwJ9APO8//BdsrKqAiMeXkNrYJ\r
+ jEKzkHTPQtI9C6F7ASPzKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl1DvdzMEr3UlNJNjKDA5pTk\r
+ 2cH45qDSIUYBDkYlHt5A3iR/IdbEsuLK3EOMkhxMSqK8vQuAQnxJ+SmVGYnFGfFFpTmpxYcY\r
+ JTiYlUR4MwwS/YV4UxIrq1KL8mFS0hwsSuK8Klrv/IQE0hNLUrNTUwtSi2CyMhwcShK8p0CG\r
+ ChalpqdWpGXmlCCkmTg4QYbzAA1fDVLDW1yQmFucmQ6RP8Woy9E99dElRiGWvPy8VClx3jUg\r
+ RQIgRRmleXBzYAnpFaM40FvCvNtAqniAyQxu0iugJUxAS0q+xYEsKUlESEk1MEa2v/DwCla9\r
+ dLJ1xvndST8v3dry06j2luRFR6G5/d+mXu9fl7Hgkazn9wsRMlt7NkVdl5K+Z9uWp7en9o17\r
+ xsv/asafma4l280//n1d8xV7qcv68YEsUuppv7zbzIQ9pewdJRvif/hbflz+UJjJ/m/b7/xr\r
+ eYWi8ioanJtm/JD479QSFuzVocRSnJFoqMVcVJwIAIUfaFkjAwAA\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 16 Mar 2012 02:11:27 -0000\r
+\r
+Quoth Andrei POPESCU on Mar 16 at 2:30 am:\r
+> On Jo, 15 mar 12, 17:11:08, Austin Clements wrote:\r
+> > \r
+> > I think having two divergent documents covering the same thing is less\r
+> > than ideal, but perhaps they could be merged in the near future.\r
+> \r
+> I want to have this page more or less complete and descriptive. Once \r
+> this is done I should be able to rewrite it more like a reference.\r
+> \r
+> Regarding 'notmuch help search-terms':\r
+> \r
+> $ notmuch help search-terms | wc -l\r
+> 88\r
+> \r
+> IMHO that text is better suited for a manpage, the help should be just a \r
+> (very short) reference to refresh ones memory. What do you think?\r
+\r
+I'm not quite sure what you mean. That text is the man page. Though\r
+it sounds like a great idea to have a quick syntax reference at the\r
+top of the manpage so it's the first thing people see when they run\r
+'notmuch help search-terms' (and they can still scroll down to get the\r
+details if they want).\r
+\r
+> > A few comments:\r
+> > \r
+> > The section on "Languages other than English" isn't quite correct.\r
+> > Xapian has no idea what language is being used, so it will still stem\r
+> > terms in other languages, but using English stemming rules.\r
+> \r
+> Then I think it's safe to assume the results are very much dependent on \r
+> the language, so if the language has some similarities to English Xapian \r
+> might do some stemming.\r
+\r
+My point is that Xapian *will* do stemming, but using English stemming\r
+rules, whether or not the language is English. Hence it's inaccurate\r
+to say that text in other languages will be unstemmed. (Also, to be\r
+fair to Xapian, it has stemmers for a whole bunch of languages; it's\r
+notmuch that always configures it for English.)\r
+\r
+> > Notmuch doesn't use synonyms.\r
+> \r
+> Thanks.\r
+> \r
+> > It might be worth pointing out that "+term1" and "term1" are\r
+> > equivalent.\r
+> \r
+> Yes.\r
+> \r
+> > "notmuch search -term2" doesn't actually work. I've never looked in\r
+> > to why, but I've found that Xapian ignores '-' at the beginning of a\r
+> > query or a parenthesized expression.\r
+> \r
+> Not sure what you mean here. Does Xapian just ignore the '-' and \r
+> searches as if it wasn't specified? I'm usually testing stuff with \r
+\r
+I looked at this again and realized I was slightly wrong, so I had a\r
+discussion with Olly and dug more in the code. At a high level, a\r
+query is a bunch of "probs" combined with boolean operators and the\r
+actual rule is that a prob consisting solely of a single '-' term is a\r
+syntax error. And if a query has a syntax error, Xapian will re-parse\r
+the entire query without any flags (which means no boolean operators,\r
+love/hate, phrases, or wildcards).\r
+\r
+One upshot of this rule is that a standalone negation like\r
+'-tag:inbox' will actually search for messages *with* tag:inbox (just\r
+like searching for 'tag:inbox'):\r
+\r
+$ notmuch count -- -tag:inbox\r
+650\r
+$ notmuch count -- tag:inbox\r
+650\r
+$ notmuch count -- -tag:inbox x\r
+9905\r
+\r
+> 'notmuch count', but I get:\r
+> \r
+> $ notmuch count -Debian\r
+> Unrecognized option: -Debian\r
+\r
+You need to tell count that it's not an option. The standard getopt\r
+syntax for this works:\r
+ notmuch count -- -Debian\r
+\r
+> With 'search' I get results, but right now I can't think of a query to \r
+> test.\r
+> \r
+> > "notmuch search term1 -term2" will work.\r
+> \r
+> Does 'notmuch search -term1 term2' work?\r
+\r
+'notmuch search -- -term1 term2' works.\r
+\r
+> > In the brackets section, you'll need shell escaping for those queries\r
+> > to work. It might be worth pointing out the need for shell escaping\r
+> > at the beginning.\r
+> \r
+> Right, anything other than brackets and '*'?\r
+\r
+Also double quotes. E.g.,\r
+ notmuch search subject:"This may look like a phrase, but don't be fooled"\r
+will search for messages with "this" in the subject and the words\r
+"may", "look", "like", etc anywhere (and in any order).\r
+\r
+I think that's it for Xapian metacharacters, but of course things in\r
+the query terms themselves could need shell escaping. Rather than try\r
+to think about this, I generally put my whole query in single quotes\r
+unless it's something obviously trivial that won't contain any shell\r
+metacharacters.\r
+\r
+> > XOR, NEAR, and ADJ were intentionally undocumented in\r
+> > notmuch-search-terms because they may go away some day and we don't\r
+> > want people thinking they can depend on them.\r
+> \r
+> In such case I think it's better to state so.\r
+> \r
+> I'll integrate all your comments (if somebody else doesn't beat me to \r
+> it).\r
+> \r
+> Kind regards,\r
+> Andrei\r