From 8f3bcd89087e376ca71eeb21ceff4984fd3742f6 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sat, 25 Jan 2014 17:38:59 +0200 Subject: [PATCH] Re: [PATCH 0/5] lib: make folder: prefix literal --- 8f/b74b15490a10f11485adbdc4a473c0da84af4b | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 8f/b74b15490a10f11485adbdc4a473c0da84af4b diff --git a/8f/b74b15490a10f11485adbdc4a473c0da84af4b b/8f/b74b15490a10f11485adbdc4a473c0da84af4b new file mode 100644 index 000000000..6efc13aa3 --- /dev/null +++ b/8f/b74b15490a10f11485adbdc4a473c0da84af4b @@ -0,0 +1,105 @@ +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 58676431FBF + for ; Sat, 25 Jan 2014 07:39:09 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 kcCJjDjjSZgw for ; + Sat, 25 Jan 2014 07:39:04 -0800 (PST) +Received: from mail-ee0-f42.google.com (mail-ee0-f42.google.com + [74.125.83.42]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 73840431FBC for ; Sat, 25 Jan 2014 07:39:04 -0800 + (PST) +Received: by mail-ee0-f42.google.com with SMTP id e49so1472994eek.29 + for ; Sat, 25 Jan 2014 07:39:01 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:subject:in-reply-to:references + :user-agent:date:message-id:mime-version:content-type; + bh=0cQ2ZR2y4Z1VLclffGf+mhBxquGcDrpeJR6hyLiAgyI=; + b=jRVj3hdLTS9bHHH36DXw7NwN6lXfr5lR/PWRZQwilumROjhKYVCUdfo0zWR5HSiW6Q + KmdOcIuZDtBDKb1B7tIbTEd8mQnmkQwKVHmqew1tEQG2R3K9tSRRSJMEVIcgiLtRPf3f + NLBHoaRVLFwwYBno0CKtYGvZE1ifUFvucCUkdjFRQMUAMmGIWiJkziQYs4iaA1r1Qxv+ + USdB7nOyrtQ/dsmwfmBn5ETcIP5vL8y9sJYGqDVswYATzQ/h030BFA3E3lGOmIj8/NlZ + rbMCap2LDqXUmGpLQVUnvdPaxzKTZnsUJ26v0QCYRNHfYHh727y+IMfE+MDIgb7tOirz + 9UKA== +X-Gm-Message-State: + ALoCoQkLTIdLbQIxRmaIsgY5DwB/FOo4HozJEfc+DTrjagJ36UkGnESiZmzq9mKHNLDK0YSzcqcE +X-Received: by 10.14.115.8 with SMTP id d8mr237167eeh.83.1390664341930; + Sat, 25 Jan 2014 07:39:01 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id g1sm17257586eet.6.2014.01.25.07.39.00 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 25 Jan 2014 07:39:01 -0800 (PST) +From: Jani Nikula +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH 0/5] lib: make folder: prefix literal +In-Reply-To: <87r47wfltb.fsf@nikula.org> +References: + <87y525m649.fsf@awakening.csail.mit.edu> + <87r47wfltb.fsf@nikula.org> +User-Agent: Notmuch/0.17+44~ge3b4cd9 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-pc-linux-gnu) +Date: Sat, 25 Jan 2014 17:38:59 +0200 +Message-ID: <87iot8f4vg.fsf@nikula.org> +MIME-Version: 1.0 +Content-Type: text/plain +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: Sat, 25 Jan 2014 15:39:09 -0000 + +On Sat, 25 Jan 2014, Jani Nikula wrote: +> Perhaps we need to have two prefixes, one of which is the literal +> filesystem folder and another which hides the implementation details, +> like I mentioned in my mail to Peter [1]. But consider this: my proposed +> implementation does cover *all* use cases. + +Here's a thought. With boolean prefix folder:, we can devise a scheme +where the folder: query defines what is to be matched. + +For example: + +folder:foo match files in foo, foo/new, and foo/cur. +folder:foo/ match all files in all subdirectories under foo (this + would handle Tomi's use case), including foo/new and foo/cur. +folder:foo/. match in foo only, and specifically not in foo/cur or foo/new. +folder:foo/new match in foo/new, and specifically not in foo/cur (this + allows distinguishing between messages in cur and new). +folder:/ match everything. +folder:/. match in top level maildir only. +folder:"" match in top level maildir, including cur/new. + +This requires indexing all the path components with suitable +suffixes. For example, a file "foo/new/baz" would get terms "/", "foo", +"foo/", "foo/new", and "foo/new/.". A file foo/bar would get terms "/", +"foo", "foo/", and "foo/.". + +It's obviously a concern this increases the database size; not sure how +it would compare with the current stemmed probabilistic prefix. + +Opinions on this? This would really cover all use cases, and address +Austin's interface and backward compatibility concerns. + +BR, +Jani. -- 2.26.2