Page tree

Versions Compared

Key

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


Panel

On this page:

Table of Contents

Target audience:

CAST AI Administrators


Info
Summary: This page explains how to manage the Search indexes used in the Engineering Dashboard.

Introduction

The CAST Engineering Dashboard has two search options available for use:

...

The Basic Search feature in the Engineering Dashboard uses the open source Lucene search software. Lucene relies on the existence of an index which is generated automatically when the application server is started.

...

The Lucene search index is generated automatically in the following location on disk - the folder and its contents will not exist until the web application server is started for the first time:

Code Block
languagetext
WAR 1.x / 2.x
CATALINA_HOME\webapps\CAST-Engineering<dashboard>\indexesDirectory
 
orZIP for a combined war:

CATALINA_HOME\webapps\CAST-Health-Engineering\2.x
<unpacked_zip>\indexesDirectory

What governs whether the search index is generated?

By default the Engineering Dashboard is set to automatically generate the search index every time the web application server is started. This is governed by a the rebuildComponentsSearchIndexesOnStart setting in the following file:

Code Block
languagetext
WAR 1.x
CATALINA_HOME\webapps\CAST-Engineering\WEB-INF\web.xml

WAR ≥ 2.x
CATALINA_HOME\webapps\<dashboard>\WEB-INF\classes\application.properties

ZIP ≥ 2.x
<unpacked_zip>\application.properties

The setting is set to true by default:

Code Block
languagexml
web.xml

<context-param>
	<param-name>rebuildComponentsSearchIndexesOnStart</param-name>
	<param-value>true</param-value>
</context-param>

application.properties

# Rebuild Lucene components index on start if outdated (true or false)
rebuildComponentsSearchIndexesOnStart=true

How to disable the automatic search index generation

To disable the automatic search index generation:

...

, edit the following file:

Code Block
languagetext
WAR 1.x
CATALINA_HOME\webapps\CAST-Engineering\WEB-INF\web.xml

WAR ≥ 2.x
CATALINA_HOME\webapps\<dashboard>\WEB-INF\classes\application.properties

ZIP ≥ 2.x
<unpacked_zip>\application.properties

Change the setting from true to false:

Code Block
languagexml
web.xml

<context-param>
	<param-name>rebuildComponentsSearchIndexesOnStart</param-name>
	<param-value>false</param-value>
</context-param>

application.properties

# Rebuild Lucene components index on start if outdated (true or false)
rebuildComponentsSearchIndexesOnStart=false

 Following any changes you make, save

...

the file and then restart your application server so that the changes are taken into account.

...

The index will no longer be generated when the web application is started.

How to manually generate the search index

If you have chosen not to have the search index generated automatically when the web application is started, or you want to update the search index without stopping the Engineering Dashboard, you can do so as follows:

Note:
Info
  • all methods described below require the ADMIN role - see User authentication.
  • The the index will only be updated if the data in it are is not up-to-date (e.g. a new snapshot has been computed since the last index build)

RestAPI PUT request

Use the RestAPI client:

Code Block
languagetext
WAR 1.x / 2.x
http://<server>:<port>/<dashboard>/static/default.html

ZIP 2.x
http://<server>:<port>/static/default.html

You can run the following PUT request to update the index, where My_Domain is equal to the domain you have defined when installing and configuring the Engineering Dashboard - in most circumstances the domain will be "AED" or "AED1":

Code Block
languagetext
My_Domain/components-index

...

Browse to following location:

Code Block
languagetext
CATALINA_HOME\webapps\CAST-Engineering\static\WAR 1.x / 2.x
http://<server>:<port>/<dashboard>/static/diagnostic.html

ZIP 2.x
http://<server>:<port>/static/diagnostic.html

Click the Create/Update Index button for the Components index status option (click to enlarge) - If the button is greyed out, then the index is already up-to-date:

Image Modified 

Advanced search

...

Info
Note that following the generation of a new snapshot, the violations index status will change to toUpdate, therefore CAST recommends regenerating the index to take into account the data available in the new snapshot.

...

Use the following URL to access the Diagnostic page:

Code Block
languagetext
WAR 1.x / 2.x
http://<server>:<port>/<dashboard>/static/diagnostic.html

ZIP 2.x
http://<server>:<port>/static/diagnostic.html

This provides an indication of the violations index status based on the "domain":

...

Use the RestAPI client:

Code Block
languagetext
WAR 1.x / 2.x
http://<server>:<port>/<dashboard>/static/default.html

ZIP 2.x
http://<server>:<port>/static/default.html

Using the following URI with a PUT will generate the index (where <domain> is more than likely set to AED, unless you have custom domains):

...

This method will force the violations index to be generated if its status is toUpdate (i.e. the index exists but is out-of-date because a new snapshot has been computed since the index creation) every time the web application is started, i.e.:

...

...

Note
CAST only recommends using this option if your Dashboard Service schema is small - since the index is generated during web application startup, this can impact performance.

Edit the following file with a text editor:

Code Block
languagetext
WAR 1.x
CATALINA_HOME\webapps\<dashboard>CAST-Engineering\WEB-INF\web.xml

WAR ≥ 2.x
CATALINA_HOME\webapps\<dashboard>\WEB-INF\classes\application.properties

ZIP ≥ 2.x
<unpacked_zip>\application.properties

Set the following configuration to true:

Code Block
languagetext
web.xml

<context-param>
	<param-name>rebuildViolationsSearchIndexesOnStart</param-name>
	<param-value>true<value>false</param-value>
</context-param>

application.properties

# Rebuild Lucene components index on start if outdated (true or false)
rebuildViolationsSearchIndexesOnStart=false

Save the file. Next time the web application is started the index will be generated.

...

This method is to be used when you have a configuration in the domains.properties file - i.e. multiple "domains". The custom batch will generate the violations index for all the domains configured in the domains.properties file. Create the following batch files in the CATALINA_HOME\webapps\<dashboard>\WEB-INF (WAR file deployment) folder or the <unpacked_zip> (ZIP file deployment) folder and then run the launch.bat file to start the index generation:

...