Conversation
6472255 to
62a9f8c
Compare
…es elasticsearch dep to 8.17.4
There was a problem hiding this comment.
Pull Request Overview
This PR adds pagination support to the SearchService class by implementing Point-in-Time (PIT) API for efficient scrolling through large result sets in Elasticsearch. The change replaces the previous approach of retrieving all results in a single large query with a paginated approach using search_after functionality.
- Implements Point-in-Time (PIT) API with search_after pagination for large result sets
- Refactors code formatting to improve consistency and readability
- Replaces single large queries (20,000 records) with batched processing (5,000 and 1,000 record batches)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| }, ImageMetadataEntry.class); | ||
|
|
||
| List<ImageMetadataEntry> hits = extractHits(response); | ||
| if (hits.isEmpty()) |
There was a problem hiding this comment.
The empty result check for findLatestCurrentMetersPlotByPlotName no longer throws ResourceNotFoundException when no data is found. The original logic after line 353 that threw an exception for empty results has been removed, which could change the API behavior.
| Integer highestVersion = ProductIdUtils.findHighestVersionNumber(allEntries, | ||
| PRODUCT_TYPE_CURRENT_METERS_PLOT); | ||
|
|
||
| if (highestVersion == null) { |
There was a problem hiding this comment.
The check for empty results has been moved after the PIT processing, but now it only checks if highestVersion is null. If allEntries is empty, ProductIdUtils.findHighestVersionNumber will likely return null, but this doesn't provide the same specific error message that was originally thrown when no data was found.
713fec0 to
61b2f9a
Compare
No description provided.