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:pagewhen the search index is evaluated. -
DAM: the
mgnl:resourcenode content is included in themgnl:assetwhen the search index is evaluated. -
Tasks: the
mgnl:contentNodecontent is included in themgnl:taskwhen the search index is evaluated.
Customizing the Find Bar
You can configure how many search results are displayed. The configuration is found in the config.yaml file under /modules/admincentral/ in the Resource Files app.
Configurable Properties
In the table below are listed properties in the Admincentral module that affect the showing of search results.
| Property | Description | ||
|---|---|---|---|
|
optional, default is Integer defining the maximum number of search results shown from any single search supplier. |
||
|
optional List of user roles allowed in the Last editor search filter: All users are available unless specified otherwise.
|
||
|
optional, default is 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. |
||
|
optional List of search result suppliers. If undefined, it defaults to all suppliers provided by the Periscope module. See also Search result suppliers. |
||
|
optional, default is List defining the ordering of search result groups. |
Configuration Instructions
-
Open the Resource Files app.
-
Go to the
config.yamlfile under the admincentral folder.

-
Edit the file and update the properties that you want to change. For example, update
defaultCountPerSupplierto 20 if you want to see up to 20 search results.

-
Save your changes.

