Skip to content

DTSPB-5162 change search size to 100 and adding pagination and lots of refactoring#3693

Open
justiceia wants to merge 28 commits intomasterfrom
DTSPB-5162
Open

DTSPB-5162 change search size to 100 and adding pagination and lots of refactoring#3693
justiceia wants to merge 28 commits intomasterfrom
DTSPB-5162

Conversation

@justiceia
Copy link
Copy Markdown
Contributor

JIRA link (if applicable)

https://tools.hmcts.net/jira/browse/DTSPB-5162

Change description

changed query to use 100 as size with pagination instead of the ES default of 10

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@justiceia justiceia changed the title Dtspb 5162 DTSPB-5162 change search size to 100 and adding pagination Mar 11, 2026
@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

pageResults = runQuery(CAVEAT, jsonQuery).getCaveats();
allResults.addAll(pageResults);
from += dataExtractPaginationSize;
} while (!pageResults.isEmpty());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would cause an unnecessary empty-page call.
maybe we can use while (pageResults.size() == dataExtractPaginationSize);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the pagination should process the fetched cases before querying ES again, similar to the approach used in the automated notification job. Otherwise, there is a risk of an OOM exception if all 6–7k cases are fetched before processing the expiry events.

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

Copy link
Copy Markdown
Contributor

@tom-saunders-cts tom-saunders-cts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only question is whether we should have a test which confirms that we successfully loop when we have more than pageSize results (unless I've missed something here and we do?)

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

@justiceia
Copy link
Copy Markdown
Contributor Author

only question is whether we should have a test which confirms that we successfully loop when we have more than pageSize results (unless I've missed something here and we do?)

changed it a bit

@github-actions
Copy link
Copy Markdown

CCD diff report

No change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants