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 themgnl:asset
when the search index is evaluated. -
Tasks: the
mgnl:contentNode
content is included in themgnl:task
when the search index is evaluated.
Configuring the Find Bar
You can configure how many search results are displayed. To do so, use the definition decoration mechanism.
For example, the following light module configuration updates the defaultCountPerSupplier
to 3
, allowing you to see only up to 3 search results.
findBar:
defaultCountPerSupplier: 3
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. |