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 77857431FBD for ; Tue, 2 Feb 2010 12:43:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.779 X-Spam-Level: X-Spam-Status: No, score=-0.779 tagged_above=-999 required=5 tests=[AWL=-0.780, BAYES_50=0.001] autolearn=ham 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 QzSKkujS3pjg for ; Tue, 2 Feb 2010 12:43:33 -0800 (PST) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id B08D5431FAE for ; Tue, 2 Feb 2010 12:43:33 -0800 (PST) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id E8D8F19F3396; Tue, 2 Feb 2010 21:43:32 +0100 (CET) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id meMVX-8uwkWy; Tue, 2 Feb 2010 21:43:28 +0100 (CET) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id C591B19F32FF; Tue, 2 Feb 2010 21:43:28 +0100 (CET) Received: from wsheee.localnet (unknown [213.29.198.144]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id B8B6515C052; Tue, 2 Feb 2010 21:43:28 +0100 (CET) From: Michal Sojka To: Arvid Picciani Date: Tue, 2 Feb 2010 21:43:27 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.31.9; KDE/4.3.2; i686; ; ) References: <201001291049.21048.sojkam1@fel.cvut.cz> <87eil3ehjh.fsf@servo.finestructure.net> <4B686569.7030408@exys.org> In-Reply-To: <4B686569.7030408@exys.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002022143.27708.sojkam1@fel.cvut.cz> Cc: notmuch@notmuchmail.org Subject: Re: [notmuch] [PATCHv2] Preserve folder information when indexing 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: Tue, 02 Feb 2010 20:43:36 -0000 On Tuesday 02 February 2010 18:48:25 Arvid Picciani wrote: > On Tue, 2 Feb 2010 16:01:08 +0100, Michal Sojka > > wrote: > > Stores the folder (directory name) of the message in the database as a > > term with folder prefix. Hi, I've just made several experiments. I tested both Maildir layout (your case) and non-Maildir layout and both layouts work correctly. Then I tried to create notmuch database without this patch and then add new mails and run notmuch new with the patch. It seems that in that case no folder terms are added to the database. Probably DATABASE_VERSION should be increased by this patch, but I do not want to do it until it is clear that this patch will be merged. Otherwise, there might be collision with other patches. > > unfortunately it doesnt do anything here :/ > i rebuilt the entire index, but no folder: field is added. How did you rebuild it? I deleted the .notmuch directory and run notmuch new. > can anyone who got it working tell me their directory layout? > mine would be something like: If the above didn't help, try to apply this patch. If you see your folder names during notmuch new, it should work. Michal ---- 8< ------ diff --git a/lib/database.cc b/lib/database.cc index ba2aa16..a22e226 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1436,6 +1436,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch, date = notmuch_message_file_get_header (message_file, "date"); _notmuch_message_set_date (message, date); + printf("folder=%s\n", folder_name); if (folder_name != NULL) _notmuch_message_gen_terms (message, "folder", folder_name);