From b986c4375b8eab529d7dd577ab1005bc74a86c0b Mon Sep 17 00:00:00 2001 From: Luke Cyca Date: Thu, 8 Oct 2020 15:36:39 -0700 Subject: [PATCH] Created Full-text search (markdown) --- docs/content/advanced/full-text-search.md | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 docs/content/advanced/full-text-search.md diff --git a/docs/content/advanced/full-text-search.md b/docs/content/advanced/full-text-search.md new file mode 100644 index 00000000..de9c96e9 --- /dev/null +++ b/docs/content/advanced/full-text-search.md @@ -0,0 +1,52 @@ +Full-text search allows all messages to be indexed, so that mail clients can quickly and efficiently search messages by their full text content. + +## Overview + +The [dovecot-solr Plugin](https://wiki2.dovecot.org/Plugins/FTS/Solr) is used in conjunction with [Apache Solr](https://lucene.apache.org/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: + image: tvial/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 = fts fts_solr + +plugin { + fts = solr + fts_autoindex = yes + fts_solr = url=http://solr:8983/solr/dovecot/ +} +``` + +3. Start the solr container: `docker-compose up -d --remove-orphans solr` + +4. Restart the mailserver container: `docker-compose restart mailserver` + +5. 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 on #905 \ No newline at end of file