[Dovecot] When are search indexes updated?

Timo Sirainen tss at iki.fi
Tue Dec 4 19:17:43 EET 2012


On 4.12.2012, at 18.57, Dave Abrahams wrote:

> Here's a further experience report with questions inline:
> 
> 1. "doveadm index '*'" crashes in clucene (for me), so it must be trying
>   to update the FTS indexes, somehow.  Is that (the updating, not the
>   crashing) intended behavior, and if so, should it be documented?

doveadm index always triggers adding any unindexed messages to Dovecot index with mbox/Maildir code. With [sm]dbox all mails are always indexed, so this part doesn't do anything with them.

When fts plugin is enabled, dovecot index also triggers the fts index updating of all messages not yet in the fts index. You usually should use the -q ("queue") parameter so that doveadm index only tells indexer process to start indexing. Without -q parameter the doveadm process itself does the indexing, but this is problematic with fts-lucene if another process attempts to index the mails at the same time. -q doesn't wait for indexer to finish.

> 2. "doveadm search text SOMETHINGthatWONTbeFOUND" takes a long time and
>   finds stuff without crashing, but doesn't seem to create the
>   lucene-indexes/ directory in my mdbox, and it takes a long time the
>   next time around.  Is "doveadm search" intended to update the FTS
>   indexes if they're missing?

Yes. It should trigger the same doveadm index -q code. Maybe you have a (permission) problem connecting to indexer process. It should write about that to stderr.

> 3. Performing a search on a large mailbox through IMAP takes a long time
>   the first time around, during which "top" shows the big cpu hog is
>   /opt/local/libexec/dovecot/indexer-worker, lucene-indexes/ is
>   created, and subsequent searches go quickly.  Nice!  Is there a
>   reasonably easy way to start such a search on all my mailboxes from
>   the command line by using doveadm or the preauth tunnel?

doveadm index -q / imap SEARCH body asdfg



More information about the dovecot mailing list