From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id C4D126DE012F for ; Mon, 29 Aug 2016 03:29:12 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.544 X-Spam-Level: X-Spam-Status: No, score=-0.544 tagged_above=-999 required=5 tests=[AWL=-0.533, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nkjIsysiND3X for ; Mon, 29 Aug 2016 03:29:11 -0700 (PDT) Received: from e.thregr.org (e.thregr.org [80.68.88.20]) by arlo.cworth.org (Postfix) with ESMTPS id 700D06DE00EB for ; Mon, 29 Aug 2016 03:29:11 -0700 (PDT) Received: from [2a02:27e8:20:9049:56ee:75ff:fe83:444c] (helo=localhost) by e.thregr.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1beJoN-0001jV-LQ for notmuch@notmuchmail.org; Mon, 29 Aug 2016 12:29:03 +0200 From: Yuri D'Elia To: notmuch@notmuchmail.org Subject: Query operators Date: Mon, 29 Aug 2016 12:29:03 +0200 Message-ID: <87y43fq368.fsf@wavexx.thregr.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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, 29 Aug 2016 10:29:12 -0000 Hi everyone, I'm a bit baffled by the query syntax. Reading the manual: ``Each term in the query will be implicitly connected by a logical AND if no explicit operator is provided (except that terms with a common prefix will be implicitly combined with OR).'' I would have assumed that: term1 (tag:term2 tag:term3) would be equivalent to: term1 AND (tag:term2 AND tag:term3) but if I read carefully (and by looking at the query results), since tag: is a common prefix between term2 and term3, it is actually: term1 AND (tag:term2 OR tag:term3) am I right? Is this a feature of the xapian query syntax? (can it be tweaked to _unconditionally_ AND all terms?) For me, the idea that two terms can be ORed if the prefix is the same can cause queries to return unexpected results. What about: term1 xterm2 xterm3 term2 Is this: term1 AND (xterm2 OR xterm3) AND term2 or is it: term1 OR xterm2 OR xterm3 OR term2 ?