Next, you delete the existing data in OpenSearch.
>
Before you begin
Back up your OpenSearch data before you delete it.
About this task
IBM® Business Automation
Insights uses the
following OpenSearch indices to store case events:
icp4ba-bai-case-timeseries-idx-ibm-bai-*,
icp4ba-bai-case-summaries-active-idx-ibm-*, and
icp4ba-bai-case-summaries-completed-idx-ibm-bai-*.
Process events for Case are stored in the following indices, with category
'icm'. Note that those indices also have BPMN
events.
icp4ba-bai-process-summaries-active-idx-ibm-bai-*
icp4ba-bai-process-summaries-completed-idx-ibm-bai-*
Procedure
-
Run the following commands:
a. Define NAMESPACE if it is not already defined.
NAMESPACE=production # namespace where opensearch is installed
b.
export OPENSEARCH_URL="https://$(oc get route opensearch-route -o jsonpath='{.spec.host}' -n "$NAMESPACE")"
c.
export OPENSEARCH_USERNAME=$(oc get secret/opensearch-admin-user -o json -n "$NAMESPACE" | jq -r '.data|keys[0]')
d.
export OPENSEARCH_PASSWORD=$(oc extract secret/opensearch-admin-user --keys="$OPENSEARCH_USERNAME" --to=- -n "$NAMESPACE" 2>/dev/null)
-
Run the following cURL commands to delete the documents in the index:
- Replace the asterisk (*) with the actual index name.
- Or, if you are sure that all indices are used only for the Case Flink job, you can keep the
asterisk.
curl -X POST -u $OPENSEARCH_USERNAME:$OPENSEARCH_PASSWORD "https://$OPENSEARCH_URL/case-summaries-completed-*/_delete_by_query?pretty" -H 'Content-Type: application/json' --insecure -d'
{
"query": {
"match_all": {}
}
}
'
curl -X POST -u $OPENSEARCH_USERNAME:$OPENSEARCH_PASSWORD "https://$OPENSEARCH_URL/case-summaries-active-*/_delete_by_query?pretty" -H 'Content-Type: application/json' --insecure -d'
{
"query": {
"match_all": {}
}
}
'
curl -X POST -u $OPENSEARCH_USERNAME:$OPENSEARCH_PASSWORD "https://$OPENSEARCH_URL/case-timeseries-*/_delete_by_query?pretty" -H 'Content-Type: application/json' --insecure -d'
{
"query": {
"match_all": {}
}
}
'
curl -X POST -u $OPENSEARCH_USERNAME:$OPENSEARCH_PASSWORD "https://$OPENSEARCH_URL/process-summaries-completed-*/_delete_by_query?pretty" -H 'Content-Type: application/json' --insecure -d'
{
"query": {
"term": {
"category": "icm"
}
}
}
'
curl -X POST -u $OPENSEARCH_USERNAME:$OPENSEARCH_PASSWORD "https://$OPENSEARCH_URL/process-summaries-active-*/_delete_by_query?pretty" -H 'Content-Type: application/json' --insecure -d'
{
"query": {
"term": {
"category": "icm"
}
}
}
'