Installing Apache Solr

This page describes how to install and start Apache Solr and create a new Solr core based on a Magnolia configuration set.

Apache Solr is a standalone enterprise-grade search platform needed together with the Magnolia Solr module for high-performance searches of a large document set.

The installation procedure for Apache Solr described on this page is reduced to a minimum of steps required to set up, start, and use Solr with a Magnolia instance.

For a full account, please refer to the official Solr documentation at solr.apache.org/guide/.

Solr module compatibility with Apache Solr

Magnolia Solr module version Solr version

9.0.x

9.x

6.1.x

8.x

Getting Apache Solr

Download Apache Solr and extract the zip to your computer.

Version-specific installation notes

Magnolia Solr module versions 7.0, 8.0, and 9.0 contain breaking changes in the API and, unfortunately, these versions are not binary compatible with versions before 7.0.

Version 9.0

This version adds support for Solr server 9.0.
This version contains changes in solrconfig.xml and managed-schema. Please read the notes below before updating.

Updating to 9.0

Use the managed-schema and solrconfig.xml configuration files for your Solr core and for the $SOLR_HOME/server/solr/configsets/magnolia_data_driven_schema_config.

This is needed to recreate all Solr indexes because of the changes in configuration files and indexing classes. We recommend recreating the Solr core and then re-triggering indexing in Magnolia to do it.

  1. Use the solrconfig.xml and managed-schema configuration files for the $SOLR_HOME/server/solr/configsets/magnolia_data_driven_schema_config Magnolia config set.

  2. Delete the magnolia core and create it again.

    cd $SOLR_HOME/bin
    ./solr delete -c magnolia
    ./solr create_core -c magnolia -d magnolia_data_driven_schema_configs
  3. Re-trigger the indexers by changing their indexed property to false.

Version 7.0

This version contains changes in solrconfig.xml and managed-schema. Please read the notes below before updating.

Major improvements

  • Bulk and thread indexing for both Indexers and Crawlers, and other performance improvements.

  • Don’t force commit on every request (configurable).

  • Index data in the correct format. Previously, everything was indexed as string.

  • Nested indexing is now possible.

  • Automatically pre-create schema fields if an indexer is based on a content type.

  • Removed the templating classes based on the old deprecated model.

Changes in Solr 7.x configuration files

managed-schema
  • UnigueKey:

    • The id field is used as the <uniqueKey>id</uniqueKey> instead of the uuid field.

  • Updated fields:

    • <field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />

  • New fields:

    • <field name="nest_path" type="nest_path" /><fieldType name="nest_path" class="solr.NestPathField" />

  • Removed:

    • <field name="uuid" type="string" indexed="true" stored="true" required="true" multiValued="false" />

solrconfig.xml
  • Removed the SignatureUpdateProcessorFactory generating the uuid from the type and id fields.

Update to 7.0

If you don’t have any custom code, the update proceeds automatically.

If you use an old model template architecture, you need to rewrite it to solrfn templating functions.

Any custom code must be migrated into the new API, if necessary.

Use the managed-schema and solrconfig.xml configuration files for your Solr core and for the $SOLR_HOME/server/solr/configsets/magnolia_data_driven_schema_config.

This is needed to recreate all Solr indexes because of the changes in configuration files and indexing classes. We recommend recreating the Solr core and then re-triggering indexing in Magnolia to do it.

  1. Use the solrconfig.xml and managed-schema configuration files for the $SOLR_HOME/server/solr/configsets/magnolia_data_driven_schema_config Magnolia config set.

  2. Delete the magnolia core and create it again.

    cd $SOLR_HOME/bin
    ./solr delete -c magnolia
    ./solr create_core -c magnolia -d magnolia_data_driven_schema_configs
  3. Re-trigger the indexers by changing their indexed property to false.

Creating a configuration set

Create a new Magnolia configuration set by duplicating the $SOLR_HOME/server/solr/configsets/_default folder and then naming it as magnolia_data_driven_schema_configs.

In this new configuration set, you need to create or modify two files, solrconfig.xml and managed-schema:

  • solrconfig.xml, a configuration file with the most parameters affecting Solr itself.

  • managed-schema, a file that specifies:

    • which fields the Magnolia content can contain,

    • how those fields are added to the index,

    • how they are queried.

Configuration example

Please be aware that different Solr versions may require different content in the Solr configuration files. The example configuration files attached below are for Solr 9.7.0 and tested against version 6.3.2 of the Magnolia Solr module.
  • Download the following example configuration files (based on the Solr data_driven_schema_configs Config sets).

  • Use them to replace the default files in the newly created magnolia_data_driven_schema_configs/conf det:

  • Managed Schema

  • Solr Config

The configuration files are managed in the Solr search provider module git repository.

Starting Solr

Go to the $SOLR_HOME/bin folder and start the Solr server:

./solr start

Check if Solr is running

Check if Solr is running by executing the following command:

./solr status

Creating a new core

A core is a running instance of a Lucene index along with all the Solr configuration required to use it. Create a new core called magnolia:

./solr create_core -c magnolia -d magnolia_data_driven_schema_configs

Use the admin dashboard

By opening http://localhost:8983/solr/, you may use Solr’s admin dashboard. From there, you can also create cores.

The type of installation described above works for testing and development purposes. For production installation, see Taking Solr to Production (Solr latest).
Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules