App configuration with Solr

The Solr Workbench submodule of the Magnolia Solr module provides a Magnolia Solr container that can be used instead of the JCR container for list, search and thumbnail views in a content app. This page describes how to configure the submodule to use Solr’s functionality in the Magnolia Assets subapp and for indexing of the assets it manages.

The Solr container, which fetches data indexed in the Apache Solr search platform, is recommended to be used when handling large numbers of assets.

A note about search containers

Magnolia uses the following search containers that backup the search view in the UI:

  • info.magnolia.ui.workbench.search.SearchJcrContainer for Jackrabbit.

  • info.magnolia.search.solrsearchprovider.workbench.SolrContainer for Solr.

    In general you can use these containers in any JCR based Content App. Similarly, indexing is workspace-based and hence one workspace may use Jackrabbit’s indexing functionality, another one Solr’s indexing functionality.

    You can also define and use your own custom container, especially in case you need to use both Jackrabbit and Solr together in one workspace.

Installing Solr

To install Solr follow the instructions on the Installing Apache Solr page.

Creating a dedicated core for the DAM app

With Apache Solr running create a new core called dam_wokbench for the Magnolia Assets subapp:

./solr create_core -c dam_workbench -d magnolia_data_driven_schema_configs

DAM workspace indexers

The Solr Wokbench module comes with two preconfigured DAM workspace indexers:

  • damWorkbenchAssets

  • damWorkbenchFolders

To enable them, set to true the following properties:

  • /modules/content-indexer/config/indexers/damWorkbenchAssets@enabled

  • /modules/content-indexer/config/indexers/damWorkbenchFolders@enabled

For more information about configuring indexers see Indexer configuration.

You can see the preconfigured configuration by clicking the following links:

image

image

DAM app configuration

Content connector

The Solr Workbench module introduces info.magnolia.search.solrsearchprovider.workbench.SolrJcrContentConnectorDefinition which allows you to specify which client should be used.

The configuration snippet below shows how to use SolrJcrContentConnectorDefinition in the DAM app:

/<light_module>/decorations/dam-app/apps/assets.subApps.browser.contentConnector.yaml

class: info.magnolia.search.solrsearchprovider.workbench.SolrJcrContentConnectorDefinition
client: dam_workbench

The definition by YAML is a decoration.

For more about content connectors, see Content connector configuration.

Content View

The submodule provides presenter and definition classes for list, search and thumbnail views. The configuration snippet below shows SOLR-based content view definitions for the list, thumbnail and search views in the DAM app’s browser:

/<light_module>/decorations/dam-app/apps/assets.subApps.browser.workbench.contentViews.yaml

list:
  class: info.magnolia.search.solrsearchprovider.workbench.SolrListPresenterDefinition
search:
  class: info.magnolia.search.solrsearchprovider.workbench.SolrSearchPresenterDefinition
thumbnail:
  class: info.magnolia.search.solrsearchprovider.workbench.SolrThumbnailPresenterDefinition

The above definition by YAML is a decoration.

For more information about configuring content view definitions, see Content view definition configuration.

dam-solr-workbench light module

To use the Solr Workbench submodule in the DAM app, you can get a pre-configured light module from git: dam-solr-workbench.

Feedback