Cleaning indexes
The clean-index script clears the index of those tags that match the provided criteria. It can be used to delete a large set of tag indexes based on their index states, tag name criteria or a combination of both.
Download the support script package from the download server.
Log in using your TrendMiner file server credentials. If you don't know these or your credentials are not working, please contact your TrendMiner Customer Success Manager or send a support request to support@trendminer.com
Scripts are executable from every installation that has access to the TrendMiner server. There are different scripts for different operating systems included in the downloadable file (Windows, Linux, MacOS).
This article focuses on the Windows version: the clean-index.exe script which can be executed on Windows machines.
Create a configuration file e.g. "config-clean.json". The content of the config file should look like:
{ "TrendMinerSearch": "https://trendminer.example.org", "ClientId": "cleanindexes", "ClientSecret": "123e4567-e89b-12d3-a456-426614174099" }
TrendMinerSearch: the URL of the TrendMiner installation.
ClientId: The clientid can be created in ConfigHub -> Security -> Clients
Wichtig
It is important to set the correct data source access permissions before triggering the batch indexing script. The indexing script uses a separate login flow to generate a security token. Logging in and out on the application itself does not have an effect on the token.
To set the permissions the clientid needs to be added to an ACL (Access Management => Select Datasource => Add client). For more information about on how to create the clients, please refer to the userguide.
ClientSecret: The secret for the corresponding client In ConfigHub => Clients => Select Client => Options => Show secret)
Run the script
The clean index script supports the following parameters:
-config string
Configuration file to use (optional) (default "config.json")
-name string
Search by name (expression). The script will delete the index of all tags whose name matches the expression provided. E.g.
-name "*TEMP*"
will delete all indexes of tags which have "TEMP" in their name.-status string
Search by Indexing status (optional) . The script will delete the index of all tags that are in the specified status Options: OK, FAILED, IN_PROGRESS, INCOMPLETE, OUT_OF_DATE, STALE
More information on the meaning of the different statuses can be found here: Bildschirm Indexmanager
Tipp
Both name and status can be used to refine the criteria (the script will delete the index of those tags that match both).
Make sure the config file is in the same windows folder as the clean-index.exe
Open a command window and run the clean-index.exe script with the correct parameters.
Example commands:
clean-index.exe -config config-clean.json -name "[CS]18LAB*" -status STALE
clean-index.exe -config config-clean.json -status FAILED
When the script runs it will first show feedback on how many indexes will be deleted. Press ENTER to proceed and clean these indexes.