MailSuite Pro 7 documentation

Setting up Solr to improve search performance

While performing IMAP search on just the headers is usually fast, running search in message text in standard setup of MailSuite Pro could use improvement. That's done by setting up and configuring an additional search module, we use Apache Solr for this purpose.

The configuration is performed as follows:

1. Install Java:

yum install java-1.8.0-openjdk lsof  -y
mv /opt/afterlogic/etc/init.d/solr.rc /opt/afterlogic/etc/init.d/solr.rc.distrib

2. Download and unpack Solr:

wget https://downloads.apache.org/lucene/solr/8.5.1/solr-8.5.1.tgz
tar jxvf solr-8.5.1.tgz -C /opt/afterlogic/
mv /opt/afterlogic/solr-8.5.1 /opt/afterlogic/solr

3. Adjust Dovecot configuration:

Edit /opt/afterlogic/etc/dovecot/dovecot.conf and make sure the following configuration setting is in place:

fts_solr = break-imap-search url=http://localhost:8983/solr/dovecot/

4. Configure Solr:

curl -O https://afterlogic.com/download/afterlogic-solr-conf.tar.bz2
chown -R afterlogic:afterlogic /opt/afterlogic/solr
/opt/afterlogic/etc/init.d/solr.rc start
sudo -u afterlogic /opt/afterlogic/solr/bin/solr create_core -c dovecot

5. Restart IMAP and Solr services:

/opt/afterlogic/etc/init.d/solr.rc restart
/opt/afterlogic/etc/init.d/dovecot.rc restart

6. Initialize search index:

/opt/afterlogic/bin/doveadm -v index -A  "*"

NB: For better performance, it's recommended to use the server with at least 4Gb RAM available.