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 Assets app 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 Assets app:

./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 at the following links:

Node nameValue

 
damWorkbenchAssets


 
clients


 
dam_workbench

dam_workbench

 
fieldMappings


 
caption

asset_caption

 
contributor

asset_contributor

 
copyright

asset_copyright

 
coverage

asset_coverage

 
description

asset_description

 
extension

asset_extension

 
fileName

asset_filename

 
languages

asset_languages

 
name

asset_name

 
publisher

asset_publisher

 
relation

asset_relation

 
source

asset_source

 
subject

asset_subject

 
title

asset_title

 
enabled

false

 
nodeType

mgnl:asset

 
pull

true

 
rootNode

/

 
type

dam-workbench

 
workspace

dam

Node nameValue

 
damWorkbenchFolders


 
clients


 
dam_workbench

dam_workbench

 
fieldMappings


 
enabled

false

 
nodeType

mgnl:folder

 
pull

false

 
rootNode

/

 
type

dam-workbench

 
workspace

dam

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
Node nameValue

 
contentConnector


 
nodeTypes


 
class

info.magnolia.search.solrsearchprovider.workbench.SolrJcrContentConnectorDefinition

 
client

dam_workbench

 
defaultOrder

jcrName

 
rootPath

/

 
workspace

dam

The definition by YAML is a decoration, whereas the definition by JCR is a full configuration.

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
Node nameValue

 
list


 
class

info.magnolia.search.solrsearchprovider.workbench.SolrListPresenterDefinition

 
columns


 
search


 
class

info.magnolia.search.solrsearchprovider.workbench.SolrSearchPresenterDefinition

 
columns


 
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.

#trackbackRdf ($trackbackUtils.getContentIdentifier($page) $page.title $trackbackUtils.getPingUrl($page))