Configuring search in Magnolia

By default, Magnolia’s search functionality is provided by the Jackrabbit repository which uses the default Lucene algorithm to calculate the score for ranking results.

For more advanced search options and especially if you need to manage high volumes of assets, you can set up Magnolia to use Solr search.

Jackrabbit allows you to control which properties of a node are indexed and how much they will affect the jcr:score value which represents the full-search score of the node serving as a measure of that node’s relevance to the full-text search expression result. Once those properties are defined in the index configuration file, Lucene calculates how to index the content of a workspace.

Lucene

Magnolia’s search works using the Lucene algorithm where by default all properties mentioned in the index-rule receive a boost value of 1.0.

For example

//*[jcr:contains(.,'apache')] order by @jcr:score descending

jcr:score Text property

1000

"Apache Jackrabbit"

848

"some test jackrabbit apache, apache is great"

350

"this is a text that is much larger than the first one and only contains the word apache once."

While all workspaces have the mgnl:tags property indexed, not all of them have the same configuration:

  • Pages : the title properties receive a boost of 3.0. The components and areas node contents are also included in the mgnl:page when the search index is evaluated.

  • DAM: the mgnl:resource node content is included in the mgnl:asset when the search index is evaluated.

  • Tasks: the mgnl:contentNode content is included in the mgnl:task when the search index is evaluated.

Configuring the Find Bar

You can configure how many search results are displayed.

To do so:

  1. Open the Resource Files app.

  2. Go to the config.yaml file under the admincentral folder.
    Resource Files app

  3. Edit the file and update the properties that you want to change. For example, update defaultCountPerSupplier to 20 if you want to see up to 20 search results.
    Updating the search results display

  4. Save your changes.

Configurable properties

In the table below are listed properties in the Admincentral module that affect the showing of search results.

Table 1. Subset of findBar properties
Property Description

defaultCountPerSupplier

optional, default is 10

Integer defining the maximum number of search results shown from any single search supplier.

editorRoles

optional

List of user roles allowed in the Last editor search filter:
List of authorized user roles

All users are available unless specified otherwise.

By allowing all user roles in editorRoles, you may experience performance issues, especially when a large number of public users are registered in a shared user repository on the author instance and you open a Find Bar filter.

minimumSearchLength

optional, default is 3

Configure the minimum number of necessary characters that are shown in a text hint in the find bar to help the user understand how to use the search feature.
Findbar with text hint

suppliers

optional

List of search result suppliers. If undefined, it defaults to all suppliers provided by the Periscope module.

supplierOrder

optional, default is apps, pages, stories, assets, tours

List defining the ordering of search result groups.

Configuring in-app search filters

In-app search is available in the Pages and Assets apps.

To configure existing search filters or add new ones:

  1. Go to the Resource Files app.

  2. Find the configuration of the app (pages-app.yaml for Pages, dam.subApps.yaml for Assets).

  3. Look for filteringWorkbench and modify the configuration of the existing filters or add a new filter.

Default configuration for in-app search filters in:

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