Bulk sync assets for global search (IBM Knowledge Catalog)
To start using the global search indexed data for assets, you need to run the bulk sync utility after the upgrade. The procedure is applicable after the upgrade from any version before 4.7.2 to 4.7.2 and any later versions. After you complete the procedure, you will be able to search for assets using the global search bar.
Prerequisites
Required roles
To complete this task, you must have one of the following roles:
- Cluster administrator
- Instance administrator
Bulk sync
To enable this feature, run a bulk sync for the global search index. Ensure you are logged into the cluster as an administrator or through the command line.
-
Copy the following script into your local environment as
cpd_gs_sync.sh:#!/bin/bash function prompt_for_namespace(){ read -p "Please provide namespace in which WKC is installed: " NAMESPACE echo "Job will be deployed into \"$NAMESPACE\" namespace" } function all_container_confirmation(){ read -p "ARE YOU SURE YOU WANT TO CONTINUE? THIS WILL AFFECT ALL CONTAINERS, AND MAY TAKE A LONG TIME. TYPE \"YES\" TO PROCEED: " PROCESS_ALL if [[ $PROCESS_ALL != "YES" ]]; then echo "Job run cancelled." exit 0 fi echo "All containers will be processed" } function prompt_for_list_of_catalogs(){ read -p "Please provide the list of containers to synchronize separated by commas, empty list indicates processing all containers(catalog/project/space): " CATALOGS_STRING IFS=', ' read -r -a CATALOGS <<< "$CATALOGS_STRING" if [[ $CATALOGS_STRING == "" ]]; then all_container_confirmation else echo "Following containers will be processed: " for index in "${!CATALOGS[@]}" do echo "$index - ${CATALOGS[index]}" done fi } function construct_db_list_string(){ DB_STRING="[" first=true for index in "${!CATALOGS[@]}" do if [ $first == false ]; then DB_STRING+="," fi first=false DB_STRING+="\"${CATALOGS[index]}\"" done DB_STRING+="]" } function patch_cronjob(){ oc set env -n $NAMESPACE cronjob/wkc-search-reindexing-cronjob dbs_to_sync=$DB_STRING } function spawn_job(){ oc delete job -n $NAMESPACE wkc-search-reindexing-job oc create job -n $NAMESPACE --from=cronjob/wkc-search-reindexing-cronjob wkc-search-reindexing-job } function restore_cronjob(){ oc set env -n $NAMESPACE cronjob/wkc-search-reindexing-cronjob dbs_to_sync=[] } prompt_for_namespace prompt_for_list_of_catalogs construct_db_list_string patch_cronjob spawn_job restore_cronjob -
Execute the code from step 1, using the following command:
chmod +x ./cpd_gs_sync.sh -
Execute the job, using the following command:
./cpd_gs_sync.shFollow the prompts in the terminal to customize the job as required.
Note: If the list of containers is empty, all of the catalogs, projects, and workspaces will be resynched. -
Run the following command to check the status of the job (
wkc-search-reindexing-job):oc get jobs -n ${CPD_INSTANCE_PROJECT} -w | grep reindexingOnce the job is complete, the status will display:
wkc-search-reindexing-job 1/1 3m52s 20m
Parent topic: Administering IBM Knowledge Catalog