Adding Indexer Configuration
Indexer is designed to perform all the indexing tasks of the digit platform. The service reads records posted on specific kafka topics and picks the corresponding index configuration from the yaml file provided by the respective module configuration. Configurations are yaml based. Detailed guide to create indexer configs are mentioned in the following document - Indexer Configuration Guide .
For our guide, we will create a new file under egov-indexer in configs repo by the name of digit-developer-guide.yml
and put the following content into it -
ServiceMaps:
serviceName: Voter Registration Service
version: 1.0.0
mappings:
- topic: save-vt-application
configKey: INDEX
indexes:
- name: vtindex-v1
type: general
id: $.id
isBulk: true
timeStampField: $.auditDetails.createdTime
jsonPath: $.VoterRegistrationApplications
customJsonMapping:
indexMapping: {"Data":{"voterapplication":{},"history":{}}}
fieldMapping:
- inJsonPath: $
outJsonPath: $.Data.voterapplication
externalUriMapping:
- path: http://localhost:8282/egov-workflow-v2/egov-wf/process/_search
queryParam: businessIds=$.applicationNumber,history=true,tenantId=$.tenantId
apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.amritsar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"}]}}}
uriResponseMapping:
- inJsonPath: $.ProcessInstances
outJsonPath: $.Data.history
- topic: update-vt-application
configKey: INDEX
indexes:
- name: vtindex-v1
type: general
id: $.id
isBulk: true
timeStampField: $.auditDetails.createdTime
jsonPath: $.VoterRegistrationApplications
customJsonMapping:
indexMapping: {"Data":{"tradelicense":{},"history":{}}}
fieldMapping:
- inJsonPath: $
outJsonPath: $.Data.tradelicense
externalUriMapping:
- path: http://localhost:8282/egov-workflow-v2/egov-wf/process/_search
queryParam: businessIds=$.applicationNumber,history=true,tenantId=$.tenantId
apiRequest: {"RequestInfo":{"apiId":"org.egov.pt","ver":"1.0","ts":1502890899493,"action":"asd","did":"4354648646","key":"xyz","msgId":"654654","requesterId":"61","authToken":"d9994555-7656-4a67-ab3a-a952a0d4dfc8","userInfo":{"id":1,"uuid":"1fec8102-0e02-4d0a-b283-cd80d5dab067","type":"EMPLOYEE","tenantId":"pb.amritsar","roles":[{"name":"Employee","code":"EMPLOYEE","tenantId":"pb.amritsar"}]}}}
uriResponseMapping:
- inJsonPath: $.ProcessInstances
outJsonPath: $.Data.history