Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Add Solr FullTextSearch to dovecot #1176

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/dovecot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN pip3 install "podop>0.2.5"

# Image specific layers under this line
RUN apk add --no-cache \
dovecot dovecot-lmtpd dovecot-pop3d dovecot-submissiond dovecot-pigeonhole-plugin rspamd-client \
dovecot dovecot-lmtpd dovecot-pop3d dovecot-submissiond dovecot-pigeonhole-plugin dovecot-fts-solr rspamd-client \
&& mkdir /var/lib/dovecot

COPY conf /conf
Expand Down
6 changes: 6 additions & 0 deletions core/dovecot/conf/dovecot.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ postmaster_address = {{ POSTMASTER }}@{{ DOMAIN }}
hostname = {{ HOSTNAMES.split(",")[0] }}
submission_host = {{ FRONT_ADDRESS }}

mail_plugins = $mail_plugins fts fts_solr
plugin {
fts = solr
fts_solr = url=http://solr:8983/solr/dovecot/
}

###############
# Mailboxes
###############
Expand Down
24 changes: 24 additions & 0 deletions optional/solr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM alpine:3.10
# python3 shared with most images
RUN apk add --no-cache \
python3 py3-pip git bash \
&& pip3 install --upgrade pip

# Image specific layers under this line
RUN apk add --no-cache bash openjdk11-jre
COPY start.py /start.py

RUN wget -q -O- http://apache.mirror.digionline.de/lucene/solr/8.2.0/solr-8.2.0.tgz | tar xz -C /tmp
RUN mv /tmp/solr-8.2.0/ /opt/solr
RUN adduser -S -D solr
ADD conf/dovecot/ /opt/solr/server/solr/dovecot/
ADD conf/coredata /tmp/coredata

RUN chown -R solr /opt/solr

EXPOSE 8983/tcp
VOLUME /opt/solr/server/solr/dovecot/data

CMD /start.py

HEALTHCHECK --start-period=350s CMD /opt/solr/bin/solr status | grep -q "Found 1 Solr nodes"
Binary file added optional/solr/conf/coredata/index/segments_1
Binary file not shown.
Empty file.
8 changes: 8 additions & 0 deletions optional/solr/conf/dovecot/conf/lang/contractions_ca.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Set of Catalan contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
d
l
m
n
s
t
15 changes: 15 additions & 0 deletions optional/solr/conf/dovecot/conf/lang/contractions_fr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Set of French contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
l
m
t
qu
n
s
j
d
c
jusqu
quoiqu
lorsqu
puisqu
5 changes: 5 additions & 0 deletions optional/solr/conf/dovecot/conf/lang/contractions_ga.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set of Irish contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
d
m
b
23 changes: 23 additions & 0 deletions optional/solr/conf/dovecot/conf/lang/contractions_it.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Set of Italian contractions for ElisionFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
c
l
all
dall
dell
nell
sull
coll
pell
gl
agl
dagl
degl
negl
sugl
un
m
t
s
v
d
5 changes: 5 additions & 0 deletions optional/solr/conf/dovecot/conf/lang/hyphenations_ga.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set of Irish hyphenations for StopFilter
# TODO: load this as a resource from the analyzer and sync it in build.xml
h
n
t
6 changes: 6 additions & 0 deletions optional/solr/conf/dovecot/conf/lang/stemdict_nl.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set of overrides for the dutch stemmer
# TODO: load this as a resource from the analyzer and sync it in build.xml
fiets fiets
bromfiets bromfiets
ei eier
kind kinder