Is there a way to force-index Solr for mailboxes?
-
I am testing out Solr now that I have a more powerful server memory-wise as I have a few clients who are frequently needing to search mailboxes that are several GB in size, so wanting to see how much of a different this feature makes for them.
I see in the Cloudron documentation for Full Text Search that it states:
"If you enable indexing on an server with existing mails, the first search triggers indexing of that mailbox. If that mailbox has a lot of mail, then the first search can take a long time[...]"
I'm hoping to avoid that by running the index overnight for them. Is this possible to do? I'd rather them not be stuck unable to search quickly when they need it on their first search on a business day. Any ideas how I could avoid that situation and have all mailboxes indexed by Solr before users use it?
-
A bit of a hack but the best approach is to login as the user and perform a search in the night. See https://docs.cloudron.io/user-management/#impersonate-user on how to login as another user.
I think the upstream approach is to use "doveadm index", however doveadm does not work on Cloudron because of some issue in the LDAP configuration.
-
@girish Thank you for that idea, didn't think of that before. I guess I can do that, though it'll still be a fair bit of work (more than I was hoping for haha) given the number of users and mailboxes on my server. Better than nothing though, I appreciate the outside-the-box thinking there. I'll maybe reconsider my use of that feature then for the time being as it's not a pressing issue. Hopefully in the future we'll get a way to automatically trigger that workflow of indexing all of the mailboxes.
-
If you go down this route, be sure to search via roundcube or SOGo and not rainloop because the latter does not support recursive search.
A while ago @samir shared a recipe with me to make doveadm work, let me see if that still works when I find the time.