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 5 UI 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.
Magnolia uses the following search containers that backup the search view in the UI:
|
Creating a dedicated core for the Assets app
When Apache Solr is 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 the following properties to true
:
-
/modules/content-indexer/config/indexers/damWorkbenchAssets@enabled
-
/modules/content-indexer/config/indexers/damWorkbenchFolders@enabled
For more information about configuring indexers, see Indexer configuration.
The preconfigured configuration:
Node name | Value |
---|---|
damWorkbenchAssets |
|
clients |
|
dam_wokbench |
dam_wokbench |
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 name | Value |
---|---|
damWorkbenchFolders |
|
clients |
|
dam_wokbench |
dam_wokbench |
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
. It allows you to specify which
client
should be used.
The configuration snippet below is a YAML decoration showing how to use
SolrJcrContentConnectorDefinition
in the app:
class: info.magnolia.search.solrsearchprovider.workbench.SolrJcrContentConnectorDefinition
client: dam_workbench
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 decoration snippet below shows SOLR-based content view definitions for the list, thumbnail and search views in the DAM app’s browser:
list:
class: info.magnolia.search.solrsearchprovider.workbench.SolrListPresenterDefinition
search:
class: info.magnolia.search.solrsearchprovider.workbench.SolrSearchPresenterDefinition
thumbnail:
class: info.magnolia.search.solrsearchprovider.workbench.SolrThumbnailPresenterDefinition
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.