[notmuch] [PATCHv2] Preserve folder information when indexing

Michal Sojka sojkam1 at fel.cvut.cz
Tue Feb 2 12:43:27 PST 2010


On Tuesday 02 February 2010 18:48:25 Arvid Picciani wrote:
> On Tue,  2 Feb 2010 16:01:08 +0100, Michal Sojka<sojkam1 at fel.cvut.cz>
> 
> 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);
 



More information about the notmuch mailing list