If you add or remove a dataset from SuperSERVER, you will need to update the search index to keep it in sync.
If you regularly make changes to the catalogue, you may want to consider setting up your deployment to automatically update the search index.
This section describes one option for automating search index updates: creating a batch file that automatically exports the current catalogue and executes the indexing script. Once this is set up you can configure it to run at regular intervals.
Step 1 - Create a Macro File
The first step is to create a SuperADMIN macro file that will generate a list of all the datasets on the server.
- Create a text file called createdatabaselist.sam
Open the file in a text editor and add the following commands:
This macro logs in to SuperADMIN and generates a list of all the datasets in the catalogue.
You will need to replace the username and password on the first line with the username and password of an administrator user on your deployment.
You may also need to change some of the arguments to the
createdatabaselistcommand. In particular:
- The first argument (
C:\ProgramData\STR\SuperSERVER SA\) is the prefix to be added to any relative paths. It should be set to the SuperSERVER program data directory. If SuperSERVER is not installed to the default location then you will need to change this.
- The third argument (
C:\ProgramData\STR\SuperADMIN\MetaData\MetaDataUtilities\databases.txt) is the location where the list file will be created. You will most likely want to save this file to the same directory as the search indexing script.
See the documentation for the createdatabaselist command for more information about these options.
- The first argument (
- Save your completed macro file to the SuperADMIN macros directory. By default, this is C:\ProgramData\STR\SuperADMIN\console\macros
Step 2 - Create AutoIndex.bat
The next step is to create a text file called AutoIndex.bat and save this to the same directory as the search indexing scripts. By default, this is C:\ProgramData\STR\SuperADMIN\MetaData\MetaDataUtilities
Open AutoIndex.bat in a text editor and paste in the following contents:
You may need to make some changes to this file:
- If you have installed SuperADMIN to a non standard location, you will need to update the definition of
SA_CONSOLE_INSTALL_FOLDER(line 7) to point to the directory where the SuperADMIN Console.bat script is located on your system.
- If the name of the macro file you just created is not createdatabaselist.sam then you will need to change the definition of
MACRO_TO_CREATEDATABASELIST(line 12) to match whatever you called your macro file.
- If you have multilingual datasets on your system you will need to change line 19 from
call BuildMetadataSearchIndex.bat(you will also need to make sure you have configured the required settings in the BuildMetadataSearchIndex.bat script).
Once you have finished creating AutoIndex.bat, it is a good idea to run the batch file to check it runs correctly and updates the search index. If there are any errors displayed, check your settings and try again.
Step 3 - Set up a Scheduled Task
The final step is to create a scheduled task and configure it to execute AutoIndex.bat at your preferred interval.
In Windows, you can create a scheduled task from Control Panel > System and Security > Administrative Tools > Schedule Tasks.