Skip to content
OpenCms documentation
OpenCms documentation

Basic Solr configuration

The system wide configuration of the Solr search engine is done in the opencms-search.xml. Here you can disable/enable Solr and configure the Solr server.

There are other configuration files for Solr (in the folder {webapp home}/WEB-INF/solr) whose options are not covered here.

In general the system wide search configuration for OpenCms is done in the file opencms-search.xml ({webapp home}/WEB_INF/config/opencms-search.xml). In the following subsections we explain the basic configuration options.

In the node opencms/solr you configure if you want to enable the Solr search engine at all and optionally set additional configuration options. You can also connect to an external Solr server. Here's the simplest configuration to enable the Solr search engine:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE opencms SYSTEM "http://www.opencms.org/dtd/6.0/opencms-search.dtd">
<opencms>
 <search>
   <solr enabled="true"/>
   <!-- ... -->
 </search>
</opencms>
Solr cannot be disabled for OpenCms 10.5 onwards since it is internally used by OpenCms.

The <solr> node has several optional subnodes to change default settings form the Solr server. Here is a configuration example using all options:

<solr enabled="true">
   <home>/my/solr/home/folder</home>
   <configfile>rabbit.xml</configfile>
   <commitWithinMs>10000</commitWithinMs>
   <maxProcessedResults>400</maxProcessedResults>
</solr>

Sets the Solr home folder (without trailing /). By default this is {webapp home}/WEB-INF/solr.

The name of the Solr configuration file. The default file name is solr.xml. It's URL will be concatenated as {home folder}/{file name}.

The maximal time Solr is allowed to wait between adding a document and committing it. See here for more information.

By default, Solr will return only the first 400 results of a query. So each search is limited to showing at maximum 400 results.

The reason is, that for each query a permission check on the results is performed that requires to fetch all results up to the requested ones, e.g., if you want to get result 300 to 310, permissions are checked for results 1 to at least 310.

If 400 results are not sufficient for your purpose, you can increase the number here for all Solr indexes, or adjust it on an per-index-base at the index itself, setting the parameter search.solr.maxProcessedResults at the index configuration.