Regenerating indexes for objects

Use the indexRegenerator.sh script to regenerate the object indexes of a catalog, hierarchy, or all items that are specified in a CSV file.

About this task

Due to performance impacts, run the indexRegenerator.sh script only during scheduled maintenance hours.

Procedure

Run the index regeneration script, indexRegenerator.sh from the $TOP/bin directory:
Option Description
For catalogs in a company:

When you run the indexRegenerator.sh script, the items of the catalog are iterated through, and when the script completes, the items are saved. When you save the items, new indexes are created. This process can take hours to complete if there are many items in a catalog.

  1. Run the indexRegenerator.sh script:
    Syntax
    indexRegenerator.sh --catalog=catalogName --company=companyName
    Parameters
    --catalog
    The catalogName parameter is the name of the catalog.
    You cannot combine catalog parameter with any other parameters.

    For example, the --catalog and --hierarchy parameters cannot be specified together. If you specify the --catalog and --items parameters together, .pk files only are generated and index regeneration is not performed.

    --company
    The companyName parameter is the name of the company.
For hierarchies in a company:

When you run the indexRegenerator.sh script, the categories of the hierarchy are iterated through, and when the script completes, the category tree is saved. When you save the category tree, new indexes are created.

  1. Run the indexRegenerator.sh script:
    Syntax
    indexRegenerator.sh --hierarchy=hierarchyName --company=companyName
    Parameters
    --hierarchy
    The hierarchyName parameter is the name of the hierarchy.
    You cannot combine hierarchy parameters with any other parameters.

    For example, the --hierarchy and --catalog parameters cannot be specified together.

    --company
    The companyName parameter is the name of the company.
For items in a company:

When you run the indexRegenerator.sh script, the items are iterated through, and when the script completes, the items are saved. When you save the items, new indexes are created.

  1. Prepare a CSV file to specify all the items that you want to regenerate indexes for.
  2. Run the indexRegenerator.sh:
    Syntax
    indexRegenerator.sh --items=CSV_file_dir --company=companyName --encoding=encoding
    Parameters
    --items
    The CSV_file_dir parameter is the fully qualified directory of the CSV file.

    You must specify pairs of catalog names and item primary key values for each item and separate each pair with a comma. For parameter values that contain spaces, you must enclose the parameter value between quotation marks ("). For special characters in parameter values that are not enclosed between quotation marks, you must escape every special character with a backslash (\). If you specify more than one file, insert a file number before the file extension. For example, items.csv becomes items-1.csv or items-2.csv.

    If you specify the --items and --catalog parameters together, .pk files only are generated and index regeneration is not performed.
    --company
    The companyName parameter is the name of the company.
    --encoding
    The encoding parameter is only for the type of items. If not specified, the value that is specified for the charset_value parameter in the common.properties file is used.

Example

In this example, the indexRegenerator.sh script is run on the items that are listed in the CSV file $TOP/item-list.csv, in the company that is named test_Co, and uses the utf8 encoding type.
$TOP/bin/indexRegenerator.sh --items=$TOP/item-list.csv --company=test_Co --encoding=utf8