Property Reindexing

Step-1: Delete the index for property-services

1curl -XDELETE http://elasticsearch-client-v1.es-cluster:9200/property-services-enriched

Step-2: Create new index

1curl -XPUT -H "Content-Type: application/json"  http://elasticsearch-client-v1.es-cluster:9200/property-services-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" : [{ "add" : { "index" : "property-services-enriched", "alias" : "property-services" } } ]}'

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

1curl -X DELETE http://kafka-connect.kafka-cluster:8083/connectors/property-services-enriched-es-sink

Step-5: Create a new Kafka connector

1curl -X POST \ 2 3http://kafka-connect.kafka-cluster:8083/connectors/ \ 4 5-H 'Content-Type: application/json' \ 6 7-H 'Cookie: SESSIONID=f1349448-761e-4ebc-a8bb-f6799e756185' \ 8 9-H 'Postman-Token: adabf0e8-0599-4ac9-a591-920586ff4d50' \ 10 11-H 'cache-control: no-cache' \ 12 13-d '{ 14 15"name": "property-services-enriched-es-sink", 16 17"config": { 18 19"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector", 20 21"type.name": "licenses", 22 23"tasks.max": "1", 24 25"max.retries": "15", 26 27"key.ignore": "false", 28 29"retry.backoff.ms": "5000", 30 31"max.buffered.records": "2000", 32 33"value.converter": "org.apache.kafka.connect.json.JsonConverter", 34 35"errors.log.enable": "true", 36 37"key.converter": "org.apache.kafka.connect.storage.StringConverter", 38 39"read.timeout.ms": "10000", 40 41"topics": "property-services-enriched", 42 43"batch.size": "1000", 44 45"max.in.flight.requests": "2", 46 47"schema.ignore": "true", 48 49"behavior.on.malformed.documents": "warn", 50 51"flush.timeout.ms": "3600000", 52 53"errors.deadletterqueue.topic.name": "property-services-enriched-failed", 54 55"errors.tolerance": "all", 56 57"value.converter.schemas.enable": "false", 58 59"name": "property-services-enriched-es-sink", 60 61"connection.url": "http://elasticsearch-client-v1.es-cluster:9200", 62 63"linger.ms": "1000", 64 65"transforms": "TopicNameRouter", 66 67"transforms.TopicNameRouter.type": "org.apache.kafka.connect.transforms.RegexRouter", 68 69"transforms.TopicNameRouter.regex": "property-services-enriched*", 70 71"transforms.TopicNameRouter.replacement": "property-services-enriched" 72 73} 74 75}'

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 -X POST \ 2 3 http://egov-indexer.egov:8080/egov-indexer/index-operations/_legacyindex \ 4 5 -H 'Cache-Control: no-cache' \ 6 7 -H 'Content-Type: application/json' \ 8 9 -H 'Postman-Token: d380bebb-383f-1b7c-76d1-10c1dc07dd06' \ 10 11 -d '{ 12 13    "RequestInfo": { 14 15        "apiId": "Rainmaker", 16 17        "ver": ".01", 18 19        "ts": "", 20 21        "action": "_create", 22 23        "did": "1", 24 25        "key": "", 26 27        "msgId": "20170310130900|en_IN", 28 29        "authToken": "34049f85-7ace-4a6c-8b43-8bc842b02d00", 30 31        "userInfo": { 32 33            "id": 150, 34 35            "userName": "TLCreator-Dehradun", 36 37            "name": "Mr  Om Prakash Jaiswal", 38 39            "type": "EMPLOYEE", 40 41            "mobileNumber": "9999999999", 42 43            "emailId": "free2jaiswal@Gmail.com", 44 45            "roles": [ 46 47                { 48 49                    "id": null, 50 51                    "name": "PT Document Verifier", 52 53                    "code": "PTDOCVERIFIER", 54 55                    "tenantId": "uk.dehradun" 56 57                }, 58 59                { 60 61                    "id": null, 62 63                    "name": "Employee", 64 65                    "code": "EMPLOYEE", 66 67                    "tenantId": "uk.dehradun" 68 69                }, 70 71                { 72 73                    "id": null, 74 75                    "name": "TL Counter Employee", 76 77                    "code": "TL_CEMP", 78 79                    "tenantId": "uk.dehradun" 80 81                }, 82 83                { 84 85                    "id": null, 86 87                    "name": "PT Approver", 88 89                    "code": "PTAPPROVER", 90 91                    "tenantId": "uk.dehradun" 92 93                }, 94 95                { 96 97                    "id": null, 98 99                    "name": "Trade License Document verifier", 100 101                    "code": "TL_DOC_VERIFIER", 102 103                    "tenantId": "uk.dehradun" 104 105                }, 106 107                { 108 109                    "id": null, 110 111                    "name": "TL Approver", 112 113                    "code": "TL_APPROVER", 114 115                    "tenantId": "uk.dehradun" 116 117                }, 118 119                { 120 121                    "id": null, 122 123                    "name": "PT Field Employee", 124 125                    "code": "PTFEMP", 126 127                    "tenantId": "uk.dehradun" 128 129                }, 130 131                { 132 133                    "id": null, 134 135                    "name": "PT Counter Employee", 136 137                    "code": "PTCEMP", 138 139                    "tenantId": "uk.dehradun" 140 141                }, 142 143                { 144 145                    "id": null, 146 147                    "name": "DATA ENTRY ADMIN", 148 149                    "code": "DATAENTRY_ADMIN", 150 151                    "tenantId": "uk.dehradun" 152 153                } 154 155            ], 156 157            "tenantId": "uk.dehradun", 158 159            "uuid": "9a3bbbdb-c5a6-4405-a098-90ebffdc34e1" 160 161        } 162 163    }, 164 165    "apiDetails": { 166 167        "uri": "http://property-services:8080/property-services/property/_plainsearch", 168 169        "paginationDetails": { 170 171            "offsetKey": "offset", 172 173            "sizeKey": "limit", 174 175            "maxPageSize": 100, 176 177            "startingOffset": 0 178 179        }, 180 181        "responseJsonPath": "$.Properties" 182 183    }, 184 185    "legacyIndexTopic": "property-registry-legacyIndex", 186 187    "tenantId": "uk.dehradun" 188 189}