docker-mailserver/docs/content/config/advanced/full-text-search.md
2021-04-12 10:08:17 +00:00

1.5 KiB

title
Advanced | Full-Text Search

Overview

Full-text search allows all messages to be indexed, so that mail clients can quickly and efficiently search messages by their full text content.

The dovecot-solr Plugin is used in conjunction with Apache Solr running in a separate container. This is quite straightforward to setup using the following instructions.

Setup Steps

  1. docker-compose.yml:

      solr:
        image: lmmdock/dovecot-solr:latest
        volumes:
          - solr-dovecot:/opt/solr/server/solr/dovecot
        restart: always
    
      mailserver:
        depends_on:
          - solr
        image: mailserver/docker-mailserver:latest
        ...
        volumes:
          ...
          - ./etc/dovecot/conf.d/10-plugin.conf:/etc/dovecot/conf.d/10-plugin.conf:ro
        ...
    
    volumes:
      solr-dovecot:
        driver: local
    
  2. etc/dovecot/conf.d/10-plugin.conf:

    mail_plugins = $mail_plugins fts fts_solr
    
    plugin {
      fts = solr
      fts_autoindex = yes
      fts_solr = url=http://solr:8983/solr/dovecot/ 
    }
    
  3. Recreate containers: docker-compose down ; docker-compose up -d

  4. Flag all user mailbox FTS indexes as invalid, so they are rescanned on demand when they are next searched: docker-compose exec mailserver doveadm fts rescan -A

Further Discussion

See #905