Skip to main content
Skip table of contents

Database Index Creation Guide

This document describes the steps for adding the index on conversation manager DB to improve the reporting connector performance

Steps

  1. SSH on the target server

  2. To connect to your database, create a MongoDB® client container. Run following command

    CODE
    kubectl run --namespace ef-external mongo-mongodb-client --rm --tty -i --restart='Never' --env="MONGODB_ROOT_PASSWORD=$MONGODB_ROOT_PASSWORD" --image docker.io/bitnami/mongodb:6.0.2-debian-11-r1 --command -- bash
    k exec  -it mongo-mongodb-client -n ef-external -- bash
    mongosh admin --host "mongo-mongodb"
    use conversation-manager_db
  3. Run use conversation-manager_db command and add the following indexes on conversations collection.

    CODE
    db.conversation.createIndex( { "endTime": 1 })
    db.CustomerTopicEvents.createIndex( { "customer._id": 1 })
  4. A add the following indexes on CustomerTopicEvents collection.

    CODE
    db.CustomerTopicEvents.createIndex( { "cimEvent.name": 1 })
    db.CustomerTopicEvents.createIndex( { "cimEvent.type": 1 })
    db.CustomerTopicEvents.createIndex( { "customerId": 1 })
    db.CustomerTopicEvents.createIndex( { "topicId": 1 })
    db.CustomerTopicEvents.createIndex( "recordCreationTime":1})
    db.CustomerTopicEvents.createIndex({ "cimEvent.data.channelSession.channel.channelConfig.routingPolicy.routingMode": 1 })
    db.CustomerTopicEvents.createIndex("cimEvent.data.body.type: 1 })
    db.CustomerTopicEvents.createIndex({"cimEvent.data.body.wrapups": 1 })
    
  5. Run use state-events-logger_cx_db command and add indexes on agentStateChanheEvents collection.

    CODE
    db.agentStateChangeEvents.createIndex( { "name": 1 })
    db.agentStateChangeEvents.createIndex({ "data.agentStateChanged": 1 })
    db.agentStateChangeEvents.createIndex({ "data.agentPresence.stateChangeTime": 1 })
    db.agentStateChangeEvents.createIndex({ "data.agentPresence.agentMrdStates": 1 })
    db.agentStateChangeEvents.createIndex({ "stateChangeTime": 1 })
    db.agentStateChangeEvents.createIndex({"data.agentPresence.state.name": 1 })


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.