Elasticsearch Integration for Beneficiary Search#122
Elasticsearch Integration for Beneficiary Search#122vanitha1822 wants to merge 6 commits intorelease-3.6.0from
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| * Runs sync jobs in background without blocking API calls | ||
| */ | ||
| @Service | ||
| public class AsyncElasticsearchSyncService { |
There was a problem hiding this comment.
The context of "Async" and "sync" of document to Elasticsearch are 2 different things.
Is ASync prefix necessary?
There was a problem hiding this comment.
For my reference, I kept for now. I will change once everything is completed.
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/controller/IdentityESController.java
Fixed
Show fixed
Hide fixed
src/main/java/com/iemr/common/identity/service/elasticsearch/ElasticsearchService.java
Fixed
Show fixed
Hide fixed
| @PostMapping("/single/{benRegId}") | ||
| public ResponseEntity<Map<String, Object>> syncSingleBeneficiary( | ||
| @PathVariable String benRegId) { | ||
| logger.info("Received request to sync single beneficiary: {}", benRegId); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
| @GetMapping("/debug/check/{benRegId}") | ||
| public ResponseEntity<Map<String, Object>> checkBeneficiaryExists( | ||
| @PathVariable String benRegId) { | ||
| logger.info("Checking if beneficiary exists: {}", benRegId); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
src/main/java/com/iemr/common/identity/service/elasticsearch/ElasticsearchService.java
Fixed
Show fixed
Hide fixed
| public boolean syncSingleBeneficiary(String benRegId) { | ||
| try { | ||
| logger.info("========================================"); | ||
| logger.info("Syncing single beneficiary with BenRegId: {}", benRegId); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
| // Check if beneficiary exists in database first using transactional wrapper | ||
| boolean exists = transactionalWrapper.existsByBenRegId(benRegIdBig); | ||
| if (!exists) { | ||
| logger.error("Beneficiary does not exist in database: BenRegId={}", benRegId); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
| BeneficiariesDTO benDTO = beneficiaryDataService.getBeneficiaryFromDatabase(benRegIdBig); | ||
|
|
||
| if (benDTO == null) { | ||
| logger.error("Failed to fetch beneficiary details from database: BenRegId={}", benRegId); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
| BeneficiaryDocument doc = convertToDocument(benDTO); | ||
|
|
||
| if (doc == null || doc.getBenId() == null) { | ||
| logger.error("Failed to convert beneficiary to document: BenRegId={}", benRegId); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
|
|
||
| logger.info("========================================"); | ||
| logger.info("SUCCESS! Beneficiary synced to Elasticsearch"); | ||
| logger.info("BenRegId: {}, BenId: {}", benRegId, doc.getBenId()); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
| // Save job to database | ||
| job = syncJobRepository.save(job); | ||
|
|
||
| logger.info("Created new full sync job: jobId={}, triggeredBy={}", job.getJobId(), triggeredBy); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
| * Universal search with optional user location for ranking | ||
| */ | ||
| public List<Map<String, Object>> universalSearch(String query, Integer userId) { | ||
| logger.info("Universal ES search for: {} with userId: {}", query, userId); |
Check notice
Code scanning / SonarCloud
Logging should not be vulnerable to injection attacks Low
|
|
Track in PR #123 |




📋 Description
JIRA ID:
AMM-1951
✅ Type of Change