dovecot-fts-solr Solr9 support

Shawn Heisey elyograg at elyograg.org
Fri Sep 30 17:52:22 UTC 2022


On 9/27/22 19:32, Nathanael Anderson wrote:
> I was trying a new install of dovecot w/ solr9.   I've manually fixed 
> the file linking to the proper directories, however one plugin is no 
> longer shipped.   Since the solr files aren't updated yet to 9, can 
> anyone tell me if I need the discontinued velocity plugin that was 
> default in the dovecot solr 7.7 config file.   It appears it is now a 
> third party plugin that hasn't been updated for 3 years.

The velocity stuff that Solr ships with is a templating system that 
allows Solr to host a little website showcasing its capabilities.  It is 
strongly recommended to never use this in production, as it requires 
that end users have direct network access to the Solr install, which is 
never a good idea.

Dovecot accesses the API directly and does not need velocity.

I am running a dev version of Solr 9.1.0 with the config and schema 
stripped down to just what is needed for Dovecot.  I have added the jars 
necessary for the ICU analysis components and I am using two of those 
analysis components in my schema.

I installed Solr on Ubuntu Server using the service installer script 
included in the download.  This extracts the tarball in /opt, and then 
sets up /opt/solr as a symlink to the version-specific directory in 
/opt.  It creates a directory structure under /var/solr and creates 
/etc/default/solr.in.sh.  If you use a service name other than solr, 
that will be named /etc/default/${servicename}.in.sh and I believe the 
data will go to /var/${servicename}.

For ICU, I created /var/solr/data/lib, then copied icu4j-70.1.jar and 
lucene-analysis-icu-9.3.0.jar from /opt/solr/modules/analysis-extras/lib 
to that new lib directory. Solr 9.0.0 would have lucene jars from Lucene 
9.0.0, but the 9.x branch is currently using Lucene 9.3.0.  Do not use 
<lib> config elements in solrconfig.xml to load the jars.  My 
solrconfig.xml and managed-schema.xml files can be found here:

https://paste.elyograg.org/view/97597ed3
https://paste.elyograg.org/view/dca55086

My index is quite small by Solr standards, which is why I have such a 
low maxTime on autoSoftCommit.  Larger indexes may do better with a 
larger interval there.

I use LATEST for luceneMatchVersion, which generates a warning when Solr 
starts.  I am also using 2.0 for the schema version so that it will 
automatically pick up new defaults after the 1.6 version when those 
versions are created in later versions of Solr.

This is the current contents of /etc/default/solr.in.sh with commented 
lines removed:

---------------
SOLR_PID_DIR="/var/solr"
SOLR_HOME="/var/solr/data"
LOG4J_PROPS="/var/solr/log4j2.xml"
SOLR_LOGS_DIR="/var/solr/logs"
SOLR_PORT="8983"
SOLR_HEAP="1g"
GC_TUNE=" \
   -XX:+UseG1GC \
   -XX:+ParallelRefProcEnabled \
   -XX:MaxGCPauseMillis=100 \
   -XX:+UseLargePages \
   -XX:+AlwaysPreTouch \
   -XX:+ExplicitGCInvokesConcurrent \
   -XX:ParallelGCThreads=2 \
   -XX:+UseStringDeduplication \
   -XX:+UseNUMA \
"
SOLR_JAVA_STACK_SIZE="-Xss1m"
SOLR_ULIMIT_CHECKS=false
SOLR_GZIP_ENABLED=true
SOLR_JETTY_HOST=0.0.0.0
---------------

Once you have all that in place, start and stop solr using service or 
systemctl.  Don't run the solr script directly except to create the 
index ... and for that you must run it as the solr user. Running it as 
root is prohibited by default, and forcing it will cause problems.

My Solr install is running in cloud mode, but I have removed the things 
that configure that to make this info easier to use.

One final note:  Solr 9 cannot use indexes touched by Solr 7 or 
earlier.  You will need to completely reindex.

Thanks,
Shawn



More information about the dovecot mailing list