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 222A9431FB6 for ; Wed, 4 May 2011 13:46:24 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 YtbwE7TV+i9v for ; Wed, 4 May 2011 13:46:22 -0700 (PDT) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 7AAA7431FB5 for ; Wed, 4 May 2011 13:46:22 -0700 (PDT) Received: by qyg14 with SMTP id 14so1308551qyg.5 for ; Wed, 04 May 2011 13:46:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=OZfwGwDh1VJS6Mp60ZzqNWfYgkSsF8toM7STueltqyY=; b=mVedvGcwdZzNROwo88paVWdXVlFKtfEH3p0QaLf//atwHOZTkgiL7ANfWyWtMCimQw Wzid8KZWJy9WIbadcj6xdghbfhQi+smo+mVrggvz/RfulQj5EUSjR0qypaqZiKg2AkiI GaVwyQzgL+5B5mDdcMYrkqGbp9iCiDLEfpJ/E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ZIUZ4ItRGhPCPOGbO/kqrqQq68tXf5q+zDxFWwh4XBZdSjBocps5mGpNtygcSNP3aR FlHRV/UBSpDzJv5lU5bG+fuWzS6O7w6IWaNfNL1YQDhhTZ6xjR8FKJn5Y1uCRAqdlZqo y1B6JGagLtiq6GXuijGba1zEMDez0P1t5MZns= MIME-Version: 1.0 Received: by 10.229.206.42 with SMTP id fs42mr1230626qcb.150.1304541981722; Wed, 04 May 2011 13:46:21 -0700 (PDT) Sender: amdragon@gmail.com Received: by 10.229.233.17 with HTTP; Wed, 4 May 2011 13:46:21 -0700 (PDT) In-Reply-To: <1304540796-8865-1-git-send-email-felipe.contreras@gmail.com> References: <1304540796-8865-1-git-send-email-felipe.contreras@gmail.com> Date: Wed, 4 May 2011 16:46:21 -0400 X-Google-Sender-Auth: xZrMj3CY4Q3OujZVsc_yURndGCw Message-ID: Subject: Re: [PATCH v2] test/search: add check for slightly trick search From: Austin Clements To: Felipe Contreras Content-Type: text/plain; charset=ISO-8859-1 Cc: notmuch@notmuchmail.org 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: Wed, 04 May 2011 20:46:24 -0000 On Wed, May 4, 2011 at 4:26 PM, Felipe Contreras wrote: > +output=$(notmuch search from:'search-by-from@' | notmuch_search_sanitize) I don't think this does what you think it does. Xapian only understands double quotes around phrases, not single quotes. Furthermore, a single quote after a prefix prevents that token from acting as a prefix, so you search is finding messages containing the *word* "from" and the phrase "search by from" *anywhere* (which is a phrase not because of the quotes, but because of the hyphens). The test results happen to be the same if you use single quotes or double quotes, but for very different reasons.