Back to marketplace
53

Apache SOLR

Integration of Apache Solr search platform

Installation

Solr Installation

Docker Installation

The easiest way is to spin up a Solr instance via Docker.

The following example shows how to start a Solr with configured HumHub Core:

cd /path-to-humhub/protected/modules/solr

docker run -d -p 127.0.0.1:8983:8983 \
   --name humhub_solr \
   -v $PWD/resources/solr:/humhubcore_config/conf \
   solr:9 solr-precreate humhubcore /humhubcore_config

Manual Installation

This guide covers only the basic installation and configuration steps of Apache Solr. More advanced configuration will be required, such as firewall security settings or individual performance tuning.

Note: This documentation was tested at last with Apache Solr 8.11.3 and should be compatible with all Apache Solr versions 8.0+.

  1. Install Apache Solr as described in the Solr manual.

    As quick start: Download Apache Solr and extract it to any folder (e.g. /opt/solr). After successfully extracting the file, Solr can be installed as a service in a Linux system by calling solr/bin/install_solr_service.sh.

  2. Start SOLR. e.g.

     cd /opt/solr
     su -r solr
     ./bin/solr start
    
  3. Add a new core for HumHub. e.g.

     cd /opt/solr
     ./bin/solr create -c humhubcore
    
  4. Configure the core. Make sure that this step happens before the first use of the core.

    Stop the Solr Service:

     cd /opt/solr
     ./bin/solr stop
    

    Copy configuration provided by HumHub SOLR module.

      cd /var/solr/data/humhubcore/conf
      
      cp /path-to-humhub/protected/modules/solr/resources/solr/charmap.txt .
      cp /path-to-humhub/protected/modules/solr/resources/solr/schema.xml .
      cp /path-to-humhub/protected/modules/solr/resources/solr/solrconfig.xml .  
      rm managed-schema
    
  5. Restart Apache Solr after this change!

     cd /opt/solr
     ./bin/solr restart
    

HumHub Configuration

  1. Make sure the Solr Search module is installed and enabled.

  2. Configure Module at: Administration -> Modules -> Solr ->

  3. Rebuild the search index.

     cd /path-to-humhub-here/protected
     php yii content-search/rebuild
    

    For HumHub versions prior to HumHub 1.16:

    php yii search/rebuild
    

Module Information

Latest version release:
2.1.0 - September 10, 2024
Website:
Compatibility:
HumHub 1.17 - 1.17