Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Page properties
12
Magnolia Compatibility
6.2(tick)(warning)
6.1(warning)(tick)


The Periscope Result Ranker module uses neural networks to store Find Bar search results and rank them by relevance. It extends the Periscope modules. The more you search, the more Magnolia learns what you need and the better your search results get. Magnolia makes suggestions and ranks all search results based on what it has learned from previous search patterns and the preferences of each user (local ranking) or all users on a given Magnolia instance (global ranking).

The module learns user preferences to offer better result ranking for subsequent searches. By default, search result rankings are stored per user. You can change the configuration as necessary. For example, you can enable an individual ranking for each user or for selected users only. Additionally, you can configure the memory size of networks to mitigate possible memory consumption issues in large setups.

...

Code Block
<dependency>
  <groupId>info.magnolia.forge.periscope</groupId>
  <artifactId>magnolia-periscopeai0periscope-result-ranker</artifactId>
  <version>1.2.4<0-SNAPSHOT</version>
</dependency>

Source Code

The source for this module can be found here: https://github.com/magnolia-community/periscope-ai-result-ranker

Configuration

The module comes with the following default configuration:

periscope-ai-result-ranker/src/main/resources/periscope-ai-result-ranker/config.yaml

Code Block
outputUnits: 10000
rankingNetworkStorageStrategy:
  class: info.magnolia.forge.periscope.rank.ml.jcr.JcrUsernameNetworkStorageStrategy

...

PropertyDescription
outputUnits

required, default is 10000

The memory size of neural networks.

The result-ranking system requires memory (heap space) and disk space per unit for each user (local ranking) or instance (global ranking). You can adjust the size of the memory used per unit to mitigate possible memory consumption issues (see Result Ranker memory size).

rankingNetworkStorageStrategy

required

The result-ranking memory strategy.

The default strategy stores result rankings per user. Other strategies are possible (see Result Ranker strategy).

To adjust the strategy, set the class property accordingly.

class

required, default is info.magnolia.forge.periscope.rank.ml.jcr.JcrUsernameNetworkStorageStrategy

Other possible values must be a subtype of info.magnolia.forge.periscope.rank.ml.RankingNetworkStorageStrategy.

...

The Periscope Result Ranker module creates a certain number of memory units. The total number of memory units depends on the Result Ranker strategy. The size of a single memory unit is based on the Result Ranker memory size.

Result Ranker strategy

You can set the Result Ranker strategy via the class property of the rankingNetworkStorageStrategy property.

...

Code Block
Class: info.magnolia.forge.periscope.rank.ml.jcr.JcrUsernameNetworkStorageStrategy

...

Code Block
Class: info.magnolia.forge.periscope.rank.ml.jcr.JcrUserRoleNetworkStorageStrategy

...

Large networks can store more results but use up more memory, while small networks consume less memory but might lose stored results to free up additional memory. Results are removed from networks based on a least-recently-used policy. This ensures that frequent results remain in memory irrespective of when they were added to the networks. You may want to configure the memory size of networks depending on the Result Ranker strategy.

When you change the outputUnits value (e.g. from 10000 to 1000), you need to clean up the JCR rankings workspace. Otherwise, an error will appear when you select a search result. This is because the networks loaded into memory were created using a configuration that no longer exists, rendering any stored results obsolete. When you change the outputUnits value, make sure that you delete any stored networks and log into the Magnolia instance again to regenerate networks using the new configuration (see Clearing Result Ranker memory).

Changing configuration

The Periscope Result Ranker module configuration resides in periscope-ai-result-ranker/src/main/resources/periscope-ai-result-ranker/config.yaml. The module is deployed as a JAR file, but you can change the configuration by one of the following means:

The configuration is read by the Resources module. Magnolia scans the following for a resource (in this particular order):

...

The configuration data is read on startup and after it has been changed. The actual data is stored in the module’s configuration registry. You can look it up using the Definitions app in modules > periscope-ai-result-ranker.
imageImage RemovedImage Added


Note

If you change the outputUnits value, you must delete all existing network data (see Clearing Result Ranker memory).

Changing configuration with resources hotfix

  1. Open the Resource Files app.

  2. Browse to and select periscope-ai-result-ranker > config.yaml.

  3. In the action bar, click Edit file. The Resource Files app creates a copy of the currently used configuration and stores it in the JCR resources workspace.

  4. Edit the file as necessary.
    imageImage RemovedImage Added

  5. Click Save changes.

...

Within the light module, create the file decorations/periscope-ai-result-ranker/config.yaml.

Code Block
title<magnolia.resources.dir>/test-module/decorations/periscope-ai-result-ranker/config.yaml
outputUnits: 1000 
rankingNetworkStorageStrategy: 
	class: info.magnolia.forge.periscope.rank.ml.jcr.JcrUserRoleNetworkStorageStrategy

...

Code Block
titleLinux ppc64le
<dependency> 
	<groupId>org.bytedeco.javacpp-presets</groupId> 
	<artifactId>openblas</artifactId> 
	<classifier>linux-ppc64le</classifier> 
</dependency> 
<dependency> 
	<groupId>org.nd4j</groupId> 
	<artifactId>nd4j-native</artifactId> 
	<classifier>linux-ppc64le</classifier> 
</dependency>

IBM WebSphere and Linux

If you experience a JVM crash when running Magnolia 6.2 on IBM WebSphere and Linux, disable the Periscope Result Ranker module by excluding the periscope-ai-result-ranker artifact from the dependencies of your project. For example:

Code Block
<dependencies> 
	<dependency> 
		<groupId>info.magnolia.dx</groupId> 
		<artifactId>magnolia-dx-core-demo-webapp</artifactId> 
		<type>war</type> 
		<exclusions> 
			<exclusion> 
				<groupId>info.magnolia.periscope</groupId> 
				<artifactId>magnolia-periscope-result-ranker</artifactId> 
			</exclusion> 
		</exclusions> 
	</dependency> 
	<dependency> 
		<groupId>info.magnolia.dx</groupId> 
		<artifactId>magnolia-dx-core-demo-webapp</artifactId> 
		<type>pom</type> 
		<exclusions> 
			<exclusion> 
				<groupId>info.magnolia.periscope</groupId> 
				<artifactId>magnolia-periscope-result-ranker</artifactId> 
			</exclusion> 
		</exclusions> 
	</dependency> 
	<dependency> 
		<groupId>info.magnolia</groupId> 
		<artifactId>magnolia-module-websphere</artifactId> 
	</dependency> 
</dependencies>

DL4J/ND4J issues

There are limitations on the deep-learning and search features of the Find Bar, which are provided by the Periscope and Periscope Result Ranker modules.

The ND4J library can only be initiated once. Therefore, search result ranking on public instances should be disabled by either changing the configuration of the Periscope Result Ranker module or completely removing the periscope-ai-result-ranker module from your WAR package. After this modification, the search function will be available but search results will not be ranked. For more details, see MGNLPER-112.