Skip to main content
Skip table of contents

Build keyword hierarchies for the Detailed search


Enable and build a keyword hierarchy index in the censhare Admin Client.


Context

Asset-based keyword structures in the Detailed and Expert search. Users want to search for assets in hierarchical keyword structures. The Detailed search offers a selection list of all keywords and keyword hierarchies.

As of censhare 2018.1, the Detailed search shows keyword assets in their hierarchical structure. For that purpose, censhare recreates the asset relation "Keyword hierarchy" between "Keyword" assets in a keyword hierarchy index. 

Prerequisites

You need access to the censhare Admin Client for this configuration.

Introduction

There are two ways to manage and store hierarchical keywords in censhare:

  • You can create an asset feature with a hierarchical value list in the Admin Client. Users can select keywords, but not create new ones or add a new hierarchical keyword relation.
  • The other way uses assets and asset relations. Keywords are stored as assets. These assets are hierarchically related using the "Keyword hierarchy" relation. This way of managing hierarchical keywords is more flexible. Users with the respective permissions can create new keywords and relations in censhare Web.

In the Detailed and Expert search, both types of hierarchical keywords can be used to search assets. Users can search for assets by their assigned keywords or within a keyword hierarchy. For the first type (hierarchical value list), this works out of the box. Keyword paths are indexed in the censhare database (cdb).

However, for the second type ("Keyword" assets and "Keyword hierarchy" relation), the asset structures (keyword hierarchy) are not automatically recreated and indexed in the cdb.

For this purpose, a configuration module has been introduced that also adds a server action. The module enables the automatic creation of a hierarchical index based on the "Hierarchical keyword" relations. The index is recreated every time censhare detects changes in the cdb.

Now, if a user searches for assets by keywords in the Detailed or Expert search, keyword hierarchies are shown and he can do a wildcard search (using * as a placeholder).

Configuration

In the censhare Admin Client, open the directory "Configuration / Modules / Keywords hierarchical automation" and double click on the entry "Calculate keywords hierarchical". Enable and configure the module as follows:

Field

Description

Server name

Select here the server for which you want to add a configuration. In order to index the cdb on each server, add a configuration for each server.

Enabled

The box must be checked to enable the module.

Run only on master server

For this configuration, do not check this box. See also the description for the field "Server name".

Version

This field is for internal use only.

Click OK to save your settings. This creates a custom configuration file in the "Keywords Hierarchical Automation" directory. You can add multiple configurations.

Next, you must update the server configuration in order to make the module available. To do this, click the "Update server configuration" button:

Icon

Description

Update server configuration

If you are running your system in a remote/master server configuration, synchronize the remote servers in order to transfer the configuration to the remote servers:

Icon

Description

Synchronize remote servers

Initialize the hierarchical keyword index

Next, you must initialize the keyword hierarchy by running the action once. You find it in the "Server actions" menu:

Icon

Description

Menu: Server actions

From the menu, select "Calculate keywords hierarchical". The process starts immediately. When censhare finishes the process, a dialog window presents the results. Click OK to close the window. The hierarchical keyword search is now available.

Result

When you open the drop-down list of the "Keyword (hierarchical)" field in the Detailed or Expert search, keywords are now presented hierarchically. You can select keywords in a path and use placeholders, for example: "Nature / Landscape / Mountains" and "Nature / Landscape / Mountains / *".

Creating the index may take a while. Should the keyword hierarchy not be displayed after initializing the index, restart the server. This will force censhare to create the index.

Note: Make sure that the feature key "censhare:feature.keyword-ref" is configured in the Detailed search, which references hierarchical "Keyword" assets, and not "censhare:feature.keyword". The latter refers to a hierarchical value list of keywords defined in the "Values" section of the feature (in the Admin Client). Both feature keys can be configured in the Detailed search, however, we recommend the way described in this article.

Next steps

Create your "Keyword" assets and relate them with the "Keyword hierarchy" relation.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.