From 3d90467a328ae98c3fd055975440a3a9afacd2ea Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Fri, 10 Jan 2014 00:18:31 +0200 Subject: [PATCH] [PATCH 0/5] lib: make folder: prefix literal --- 61/999db2ceca6de86ecdf0e6895c7d8509ab4d9e | 121 ++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 61/999db2ceca6de86ecdf0e6895c7d8509ab4d9e diff --git a/61/999db2ceca6de86ecdf0e6895c7d8509ab4d9e b/61/999db2ceca6de86ecdf0e6895c7d8509ab4d9e new file mode 100644 index 000000000..d7e544ef9 --- /dev/null +++ b/61/999db2ceca6de86ecdf0e6895c7d8509ab4d9e @@ -0,0 +1,121 @@ +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 1526C431FD0 + for ; Thu, 9 Jan 2014 23:00:04 -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 W0njaXu2CUrY for ; + Thu, 9 Jan 2014 22:59:56 -0800 (PST) +Received: from mail-ea0-f172.google.com (mail-ea0-f172.google.com + [209.85.215.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0F7A1429E35 + for ; Thu, 9 Jan 2014 22:57:16 -0800 (PST) +Received: by mail-ea0-f172.google.com with SMTP id q10so1538629ead.31 + for ; Thu, 09 Jan 2014 22:51:48 -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:cc:subject:date:message-id; + bh=WZ5G3IuyNPVQRRnej9T9uE9lwWDjyDHF6c1Lo2wvmkQ=; + b=UbmPiJyjpD13orTsWnDKorIebGG1YD9fp8+BMFp+EVwqMd6yIoMd2T7EFae8v6eNoH + szozY3/m76AnYotRxM9A/4wY8/P39i3qMvQCWdlM//8ef6zr3EzXhTlpVs7ozBbHf7qj + hnvxd6mK9U9/0+7lv5oCQNeR7kcvAg+OcpsDkBlh30sPTsigM/WUgCTq6XTOjrCk3PTX + 1rzTFTqImFgbKLTc1yJYGPhmTiqkxOg31gTGZZkfMk66MnYv0Oa1ktpxSRxqihGyhq3o + XlDNVQtVRmvr2R++gqxWybE+PaLSKZLaVYsFwKU5XYGoRta9DQgGpy8s0xetGKhvbiB/ + PNhg== +X-Gm-Message-State: + ALoCoQmFGHS4MmluOcgL1VM6ex2UGXrjsBuf5AXE8v1T/YHJ3AfIfyXDq6wGfmUKgVm/KzF5DEL4 +X-Received: by 10.14.104.7 with SMTP id h7mr5472562eeg.95.1389305925969; + Thu, 09 Jan 2014 14:18:45 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id a45sm9378933eem.6.2014.01.09.14.18.43 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Thu, 09 Jan 2014 14:18:45 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 0/5] lib: make folder: prefix literal +Date: Fri, 10 Jan 2014 00:18:31 +0200 +Message-Id: +X-Mailer: git-send-email 1.8.5.2 +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: Fri, 10 Jan 2014 07:00:04 -0000 + +Hi all, this series makes the folder: search prefix literal, or switches +it from a probabilistic prefix to a boolean prefix. With this, you have +to give the path from the maildir root to the folder you want in full, +including the maildir cur/new component, if any. Examples: + +folder:cur +folder:foo/bar +folder:"" + +The last one can be used to refer to the maildir root (note that in +shell you'll need quoting to pass the double quotes to xapian, +folder:'""'). + +The old probabilistic folder: prefix is problematic in a number of +ways. It's not possible to refer to the maildir root. It does stemming, +so "inboxing" would match "inbox" too. "cur" for the folder in maildir +root would match all "cur" folders across the maildir hierarchy. Likely +some others I forgot. + +WARNING! The change requires a database format version bump, and a +database upgrade, which is automatically done on 'notmuch new'. The +upgrade is irreversible if you want to try this on your database! A +complete database rebuild is required for reverting the database format +version. Make sure your backups are in order! + +The series includes some tests, including an initial upgrade test, along +with a test database in the previous format version. + + +BR, +Jani. + + + +Jani Nikula (5): + lib: make folder: prefix literal + test: fix insert folder: searches + test: fix test for literal folder: search + test: add test database in format version 1 + test: add database upgrade test from format version 1 + + lib/database.cc | 39 ++++++++- + lib/message.cc | 154 +++++++++++++++++---------------- + lib/notmuch-private.h | 3 + + test/insert | 10 +-- + test/notmuch-test | 1 + + test/search-by-folder | 24 ++++- + test/test-databases/README | 5 ++ + test/test-databases/database-v1.tar.gz | Bin 0 -> 252243 bytes + test/upgrade | 25 ++++++ + 9 files changed, 174 insertions(+), 87 deletions(-) + create mode 100644 test/test-databases/README + create mode 100644 test/test-databases/database-v1.tar.gz + create mode 100755 test/upgrade + +-- +1.8.5.2 + -- 2.26.2