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:

  • Basic search, providing search on items in the Assessment Model (i.e. rules) and on object names. Results are dependent on the location the search is made.
  • Advanced search, providing search for objects based on a list of violations. Results are not location dependent.

Each search option is governed by a separate index which produces the results. An explanation of the indexes for each search option is provided below.

Basic Search

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.

Where is the index located?

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
CATALINA_HOME\webapps\CAST-Engineering\indexesDirectory
 
or for a combined war:

CATALINA_HOME\webapps\CAST-Health-Engineering\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 setting in the following file:

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

The setting is set to true by default:

Code Block
languagexml
<context-param>
	<param-name>rebuildComponentsSearchIndexesOnStart</param-name>
	<param-value>true</param-value>
</context-param>

How to disable the automatic search index generation

To disable the automatic search index generation:

  • Edit the following file:
Code Block
languagetext
CATALINA_HOME\webapps\CAST-Engineering\WEB-INF\web.xml
  • Change the setting from true to false:
Code Block
languagexml
<context-param>
	<param-name>rebuildComponentsSearchIndexesOnStart</param-name>
	<param-value>false</param-value>
</context-param>
  •  Following any changes you make, save the web.xml 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:

Info

Note:

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

RestAPI PUT request

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":

Code Block
languagetext
My_Domain/components-index

Using the Diagnostic page

Browse to following location:

Code Block
languagetext
CATALINA_HOME\webapps\CAST-Engineering\static\diagnostic.html

Click the Update Index button (click to enlarge) - If the button is greyed out, then the index is already up-to-date:

 

Advanced search

Enabling the Advanced Search feature

"Out of the box", the Advanced Search feature is not enabled and the following message will be displayed:

This indicates that a "violations index" (on which the feature relies) has not yet been generated. To generate the index the following methods are available:

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.

Using the "Diagnostic" GUI

Info

This method requires that the user has the ADMIN role.

Use the following URL to access the Diagnostic page:

Code Block
languagetext
http://<server>:<port>/<dashboard>/static/diagnostic.html

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

  • N/A - the domain is mapped to a Measurement Service schema or the Dashboard Service schema was installed with CAST AIP < 8.3.3)
  • toCreate - no index has ever been created for this domain
  • toUpdate - an index exists for this domain, but it is outdated because a new snapshot has been computed since the index creation
  • upToDate - an index exists and is up-to-date. When this status is shown, the index for the Advanced Search feature is ready and available.

In the following example the index has never been generated since the status is set to "toCreate":

Click to enlarge

To generate the index, click the Create/Update Index button. During generation the status "Indexing" will be displayed and on completion, the status will change to "upToDate":

Click to enlarge


Using the RestAPI

Info

This method requires that the user has the ADMIN role.

Use the RestAPI client:

Code Block
languagetext
http://<server>:<port>/<dashboard>/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):

Code Block
languagetext
<domain>/violations-index

Then use the same URI with a GET will show the index status:

Generating the index when the web application starts

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.:

  • When the web application host (e.g. Apache Tomcat) starts up or restarts
  • When the web application is restarted through the Apache Tomcat management console
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
CATALINA_HOME\webapps\<dashboard>\WEB-INF\web.xml

Set the following configuration to true:

Code Block
languagetext
<context-param>
	<param-name>rebuildViolationsSearchIndexesOnStart</param-name>
	<param-value>true</param-value>
</context-param>

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

Using custom batch files

Info

This method requires that the user has the ADMIN role.

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 folder and then run the launch.bat file to start the index generation:

Code Block
languagetext
titlelaunch.bat
@echo off
@echo Computing Violations Indexes ...

util.bat > util.log
@echo --------------------------------


Code Block
languagetext
titleutil.bat
@echo off
setlocal enableDelayedExpansion
@echo Automated Violations Indexes Creation
@echo -------------------------------------
 
for /F "delims== eol=#" %%D in (domains.properties) do (
	@echo Process %%D/violations-index
	start /B util2.bat %%D
	@echo.
)

In the following file (util2.bat), you need to modify the line starting curl to match your environment:

  • Replace user:pwd with a user that has the ADMIN role and their password.
  • Replace http://localhost:8080/CAST-Health-Engineering/rest/%domain%/violations-index with the URL to your dashboard.
Code Block
languagetext
titleutil2.bat
@echo off
prompt $_
setlocal enableDelayedExpansion
set "domain=%~1"
 
@echo Start  %domain% !DATE!_!TIME!
curl -s -u user:pwd -X PUT http://localhost:8080/CAST-Health-Engineering/rest/%domain%/violations-index
@echo  is the response from %domain%
@echo Finish %domain% !DATE!_!TIME!