Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

A generic Magnolia configuration is used for all workspaces. This configuration fine-tunes the default Jackrabbit search configuration for best results. The sections that follow detail the enhancements.

 Special characters

Tip

Jackrabbit stores all character data (node names and values) in Unicode. This ensures that special characters such as accents and umlauts are indexed and can be used in search. Issues with special characters are often due to character set conversion problems in the application server. See URI encoding in Tomcat for more.

Excluding nodes

Magnolia typically stores many properties, such as author, modification dates, templates etc., that are not relevant in search results. To minimize the index and speed-up search, all properties starting with jcr: or  mgnl: are excluded from the index. This means you get fewer results but those results are more relevant.

Code Block
languagexml
<index-rule nodeType="nt:base">
    <property isRegexp="true" nodeScopeIndex="false">mgnl:.*</property>
    <property isRegexp="true" nodeScopeIndex="false">jcr:.*</property>
    <property isRegexp="true">.*:.*</property>
</index-rule>

Boosting title property

(warning) Magnolia 5.5.9+:  The generic indexing configuration used for all workspaces but the website workspace is stored in /info/magnolia/jackrabbit/indexing_configuration_default.xml . The indexing configuration for the website workspace is in /info/magnolia/jackrabbit/indexing_configuration_website.xml . You can configure indexing for additional workspaces by setting the workspace name

in <param name="indexingConfiguration" value="/info/magnolia/jackrabbit/indexing_configuration_${wsp.name}.xml"/> in the workspace.xml configuration file.

(info) If you are updating your Magnolia to 5.5.9 or later, we recommend you to set the indexing configuration by specifying workspace name(s) in the indexingConfiguration parameter.

These configurations fine-tune the default Jackrabbit search configuration for best results. The sections that follow detail the enhancements.

 Special characters

Tip

Jackrabbit stores all character data (node names and values) in Unicode. This ensures that special characters such as accents and umlauts are indexed and can be used in search. Issues with special characters are often due to character set conversion problems in the application server. See URI encoding in Tomcat for more.

Excluding nodes

Magnolia typically stores many properties, such as author, modification dates, templates etc., that are not relevant in search results. To minimize the index and speed-up search, all properties starting with jcr: or  mgnl: are excluded from the index. This means you get fewer results but those results are more relevant.The configuration boosts the title property of the mgnl:page node type since page titles are important.

Code Block
languagexml
<index-rule nodeType="mgnlnt:pagebase">
 
   <property boost="3.0">title</property>
</index-rule>

Including areas and components 

The configuration uses index aggregates to ensure area and component content is included in the index. The properties of mgnl:area and mgnl:component make up most of the contents of a page and need to be included explicitly. The aggregate also simplifies searching for content within pages. 

 isRegexp="true" nodeScopeIndex="false">mgnl:.*</property>
    <property isRegexp="true" nodeScopeIndex="false">jcr:.*</property>
    <property isRegexp="true">.*:.*</property>
</index-rule>

Boosting title property

The configuration boosts the title property of the mgnl:page node type since page titles are important.Nested areas are also included using the recursive flag. 

Code Block
languagexml
<aggregate<index-rule primaryTypenodeType="mgnl:page"> 
   <property <include primaryTypeboost="3.0">title</property>
</index-rule>

Including areas and components 

The configuration uses index aggregates to ensure area and component content is included in the index. The properties of mgnl:area and mgnl:component make up most of the contents of a page and need to be included explicitly. The aggregate also simplifies searching for content within pages. 

Nested areas are also included using the recursive flag. 

Code Block
languagexml
<aggregate primaryType="mgnl:page">
    <include primaryType="mgnl:area">*</include>
    <include primaryType="mgnl:component">*</include>
</aggregate>

<!-- areas can be nested. See mgnl:area">*</include>
    <include primaryType="mgnl:component">*</include>
</aggregate>

<!-- areas can be nested. See http://wiki.apache.org/jackrabbit/IndexingConfiguration for recursion -->
<aggregate primaryType="mgnl:area" recursive="true">
    <include primaryType="mgnl:component">*</include>
    <include primaryType="mgnl:area">*</include>
</aggregate>

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
server

 


Mgnl f
URI2RepositoryMapping

 

Mgnl n
mappings

 


Mgnl n
tours

 

Mgnl p
URIPrefix

/tours/

Mgnl p
handlePrefix

-

Mgnl p
repository

tours

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
modules

 

Mgnl f
tours

 

Mgnl f
virtualURIMapping

 


Mgnl n
toursMapping

 


Mgnl p
class

info.magnolia.cms.beans.config.RegexpVirtualURIMapping

Mgnl p
fromURI

/tours(.*).html

Mgnl p
toURI

forward:/travel/tour?tour=$1

...

Code Block
languagesql
SELECT * FROM [nt:base] AS t WHERE 
   ([jcr:primaryType] = 'mgnl:asset' AND 
   [type] <> 'jpg') AND 
   ISDESCENDANTNODE([/example]) 
ORDER BY [t].title asc
Tip

Joins are slow in JCR SQL-2. See Queries in Jackrabbit 2.4.x for issue description and hints.

Security

...

Solr module

...

].title asc
Tip

Joins are slow in JCR SQL-2. See Queries in Jackrabbit 2.4.x for issue description and hints.

Security

Search within Magnolia is access controlled. Search results include only content the user has permission to access. Permissions are controlled through Security. When you execute a query in Magnolia context (

Javadoc
info.magnolia.context.MgnlContext
info.magnolia.context.MgnlContext
), contextual factors such as the current user's permissions are taken into account. If you do not have permission to the items you are querying, they will not show up in the results.

Solr module

For more advanced search options you can use the Solr module. This module uses the  Apache Solr  search platform to index and crawl Magnolia content. Solr is a standalone enterprise search server with a REST like API. Solr uses the Lucene library for full-text indexing and provides advanced features such as faceted search, distributed search and index replication.

(warning) Magnolia 5.5.9+:  The generic indexing configuration used for all workspaces but the website workspace is stored in /info/magnolia/jackrabbit/indexing_configuration_default.xml . The indexing configuration for the website workspace is in /info/magnolia/jackrabbit/indexing_configuration_website.xml . You can configure indexing for additional workspaces by setting the workspace name

in <param name="indexingConfiguration" value="/info/magnolia/jackrabbit/indexing_configuration_${wsp.name}.xml"/> in the workspace.xml configuration file.

These configuration fine-tune the default Jackrabbit search configuration for best results. The sections that follow detail the enhancements.

(info) If you are updating your Magnolia to 5.5.9 or later, we recommend you to set the indexing configuration by specifying workspace name(s) in the indexingConfiguration parameter.