Skip to main content

Documentation Portal

Batch Indexing Instructions

Step 1

Download the batch-indexing files:

https://files.trendminer.com/batch-indexing/2021R3.1/

Note

When asked for username and password, use the corresponding customer files logins!

Scripts are executable from every windows-installation that has access to TrendMiner. There are different scripts included in the downloadable file. This article focuses on the batch-indexing.exe script.

Description of the different included scripts:

list-tags.exe returns a list of all indexed tags in TrendMiner

list-historian.exe returns a list of all tags available in the Historian.

batch-indexing.exe will start the batch indexing. This script is the focus of this document.

Step 2

3 config files are provided:

  • Config.json

  • Config-batch.json

  • Config-performance.json

Config-performance is used to test the indexing performance (not included in these instructions).

In practice, you only need config-batch.json.

Open this file (preferably in notepad++) and adjust it according to the customer's setup. The following info is required to run batch indexing.

{    
"TrendMinerSearch": "https://trendminer.example.org/hps/",    
"ClientId": "tm-indexing",    
"ClientSecret": "123e4567-e89b-12d3-a456-426614174099",    
"BatchSize": 1
}

=TrendMinerSearch=
The TrendMiner Search address, usually ends in `/hps/`

=ClientId=    
The client id to be used for all Indexing requests (In ConfigHub => Security => Clients)

=ClientSecret=    
The secret for the corresponding client In ConfigHub => Security => Clients => Select Client => Options => Show secret)

=BatchSize=    
The number of tags to index at once. Note that this does not override the number of connections in TrendMiner.

Note

The client can be created on ConfigHub and it needs an acl (Access Management => Select Datasource => Add client). For more information about on how to create the clients, please refer to the Trendminer documentation.

Note

The keyword ALL in the datasource access needs to be uppercase. In lowercase (all), it won’t work!

Step 3

Prepare a .txt file containing all tags which need to be indexed.

Format

  • No header

  • One tagname per row

  • Prefix of the historian needs to be added!

    Example:

    tags.txt

    BA:CONC.1

    [PI]BA:TEMP.1

Step 4

Move the .txt file and the config-batch.json file to the windows folder

Open a command window and navigate to the windows path containing the scripts, .txt and config-batch.json file:

Eg:  cd C:\Users\John\Desktop\support-scripts\windows

Note

For another drive it isn’ t cd, but to change the drive in Command Prompt (CMD) To access another drive, type the drive's letter, followed by ":".

For instance, if you want to change the drive from "C:" to "D:", you should type "d:"

Execute the following command:

batch-indexing.exe -tags short_tag_list.txt -min-free 0 -config config-batch.json

If everything works, you can increase the batch size in the config-batch file, e.g. to 3, and execute the command on the full tag list.

batch-indexing.exe -tags full_tag_list.txt -min-free 0 -config config-batch.json