Step-1: Delete the index for dss-collection

1curl -XDELETE "http://elasticsearch-client-v1.es-cluster:9200/egov-dss-ingest-enriched" 2curl -XDELETE http://elasticsearch-client-v1.es-cluster:9200/dss-collection_v1

Step-2: Create new index

1curl -XPUT -H "Content-Type: application/json" http://elasticsearch-client-v1.es-cluster:9200/egov-dss-ingest-enriched?pretty

Step-3: Create a new alias

1curl -XPOST "http://elasticsearch-client-v1.es-cluster:9200/_aliases" -H 'Content-Type: application/json' -d' 2{ 3 "actions" : [ 4 { "add" : { "index" : "egov-dss-ingest-enriched", "alias" : "dss-collection_v1" } } 5 ] 6}' 7

Step-4: Delete the Kafka connector and create a new one

1curl -X DELETE http://kafka-connect.kafka-cluster:8083/connectors/cms-case-es-sink9132

Step-5: Create a new Kafka connector

1curl -X POST \ 2http://kafka-connect.kafka-cluster:8083/connectors/ \ 3-H 'Content-Type: application/json' \ 4-H 'Cookie: SESSIONID=f1349448-761e-4ebc-a8bb-f6799e756185' \ 5-H 'Postman-Token: adabf0e8-0599-4ac9-a591-920586ff4d50' \ 6-H 'cache-control: no-cache' \ 7-d '{ 8"name": "cms-case-es-sink9132", 9"config": { 10"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector", 11"connection.url": "http://elasticsearch-client-v1.es-cluster:9200", 12"type.name": "general", 13"topics": "egov-dss-ingest-enriched", 14"key.ignore": "false", 15"schema.ignore": true, 16"value.converter.schemas.enable": false, 17"key.converter": "org.apache.kafka.connect.storage.StringConverter", 18"value.converter": "org.apache.kafka.connect.json.JsonConverter", 19"transforms": "TopicNameRouter", 20"transforms.TopicNameRouter.type": "org.apache.kafka.connect.transforms.RegexRouter", 21"transforms.TopicNameRouter.regex": ".*", 22"transforms.TopicNameRouter.replacement": "dss-collection_v1", 23"batch.size": 10, 24"max.buffered.records": 500, 25"flush.timeout.ms": 600000, 26"retry.backoff.ms": 5000, 27"read.timout.ms": 10000, 28"linger.ms": 100, 29"max.in.flight.requests": 2, 30"errors.log.enable": true, 31"errors.deadletterqueue.topic.name": "dss-collection_v1-es-failed", 32"tasks.max": 1 33} 34}' 35

Step-6: Once Kafka connector is created, forward port 8080 for index pod

1kubectl port-forward <indexer_name> -n egov 8080:8080

Step-7: Now run the reindexing curl command from outside the playground pod

1curl --location --request POST 'http://localhost:8080/egov-indexer/index-operations/_legacyindex' \ 2--header 'Cache-Control: no-cache' \ 3--header 'Content-Type: application/json' \ 4--header 'Postman-Token: d380bebb-383f-1b7c-76d1-10c1dc07dd06' \ 5--data-raw '{ 6 "RequestInfo": { 7 "apiId": "string", 8 "ver": "string", 9 "ts": null, 10 "action": "string", 11 "did": "string", 12 "key": "string", 13 "msgId": "string", 14 "authToken": "b843ef27-1ac6-49b8-ab71-cd0c22f4e50e", 15 "correlationId": "e721639b-c095-40b3-86e2-acecb2cb6efb", 16 "userInfo": { 17 "id": 23299, 18 "uuid": "e721639b-c095-40b3-86e2-acecb2cb6efb", 19 "userName": "9337682030", 20 "name": "Abhilash Seth", 21 "type": "EMPLOYEE", 22 "mobileNumber": "9337682030", 23 "emailId": "abhilash.seth@gmail.com", 24 "roles": [ 25 { 26 "id": 281, 27 "name": "Employee" 28 } 29 ] 30 } 31 }, 32 "apiDetails": { 33 "uri": "http://collection-services:8080/collection-services/payments/_search", 34 "tenantIdForOpenSearch": "uk.dehradun", 35 36 "paginationDetails": { 37 "offsetKey": "offset", 38 "sizeKey": "limit", 39 "maxPageSize": 100 40 }, 41 "responseJsonPath": "$.Payments" 42 }, 43 "legacyIndexTopic": "egov-payment-legacy-index", 44 "tenantId": "uk.dehradun" 45}' 46