[4.9.x] fix: ensure payload filter returns all request results #13919
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an automatic copy of pull request #13885 done by Mergify.
Issue
https://gravitee.atlassian.net/browse/APIM-10781
Description
This PR fixes a bug where using the payload/body filter in v2 API logs returned an incorrect total when matching log entries spanned multiple pages.
Root cause
The repository previously only gathered the set of log
_ids from a single page of LOG results (aligned to the user page), then applied that subset to filter REQUEST documents. When matching logs were spread across multiple pages, many matching request IDs were omitted and the total returned was incorrect.Screen.Recording.2025-10-31.at.11.46.36.PM.mov
Fix
search_after(iterative paging) and collect_ids up to a configurable cap (max_result_window) rather than relying on a single page._idset to filter the REQUEST index, and then apply the original pagination (page,size) to the REQUEST query.Screen.Recording.2025-10-31.at.11.49.09.PM.mov
Additional context