Skip to main content

Documentation Portal

Batch Indexing

The batch-indexing script indexes the tags in a given list in the background. It can be used to index a large set of tags without manual actions or follow-up in TrendMiner.

  1. 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 batch-indexing.exe script which can be executed on Windows machines.

  2. Fill in the configuration. 3 config files are provided in the downloaded files: config.json, config-batch.json and config-performance.json.

    For the batch indexing only the config-batch.json is needed.

    Open this file (preferably in notepad++) and adjust it according to the setup. The following info is required to run this script.

    {   
        "TrendMinerSearch": "https://trendminer.example.org", 
        "ClientId": "batchindexing",    
        "ClientSecret": "123e4567-e89b-12d3-a456-426614174099",    
        "BatchSize": 1
    }
    
    • TrendMinerSearch: the URL of the TrendMiner installation.

    • ClientId: The clientid can be created in ConfigHub -> Security -> Clients

      Important

      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)

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

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

    File format requirements:

    • No header

    • One tag name per line

    • Tag prefix needs to be added! 

    Example of content of tags.txt:

    batch indexing tags.txt 2023.R3.0
  4. Run the script

    The batch indexing script supports the following parameters:

    • -config string 

      Configuration file to use (optional) (default "config.json")

    • -tags string 

      A file containing a list of tags (optional)  (default "tags.txt")

    • -batch 

      Run without expecting user input (optional) 

       

    Make sure the tags.txt file and the config-batch.json file are in the same windows folder as the batch-indexing.exe

    Open a command window and run the batch-indexing.exe script with the correct parameters.

    Example commands:

    batch-indexing.exe -tags my-tags.txt -config config-batch.json 

    batch-indexing.exe -batch