Skip to content

fix(file search): apply filters before from/size parameters#741

Merged
medcl merged 1 commit intomainfrom
refactor/fs_search_limit
Jul 7, 2025
Merged

fix(file search): apply filters before from/size parameters#741
medcl merged 1 commit intomainfrom
refactor/fs_search_limit

Conversation

@SteveLauC
Copy link
Copy Markdown
Member

@SteveLauC SteveLauC commented Jul 7, 2025

What does this PR do

Before this PR, the from/size pagination parameters were applied before filtering, which could lead to incorrect query results in certain cases.

For example, suppose there are 10 files in total, and the first 5 do not match the filter criteria. If the query uses from = 0 and size = 5, applying pagination before filtering would select the first 5 files, all of which would then be filtered out — resulting in an empty result set, even though 5 matching files do exist.

This PR fixes the issue by ensuring that filters are applied first, and then pagination (from and size) is applied to the filtered results.

Rationale for this change

Standards checklist

  • The PR title is descriptive
  • The commit messages are semantic
  • Necessary tests are added
  • Updated the release notes
  • Necessary documents have been added if this is a new feature
  • Performance tests checked, no obvious performance degradation

@SteveLauC SteveLauC force-pushed the refactor/fs_search_limit branch from 236fe0b to 29dc12f Compare July 7, 2025 10:15
@SteveLauC SteveLauC changed the title fix(fs search): apply filters before from/size parameters fix(file search): apply filters before from/size parameters Jul 7, 2025
@SteveLauC SteveLauC force-pushed the refactor/fs_search_limit branch from 6e74cc0 to bb58b16 Compare July 7, 2025 11:18
@SteveLauC SteveLauC marked this pull request as ready for review July 7, 2025 11:19
@medcl medcl merged commit 119fd87 into main Jul 7, 2025
4 checks passed
@medcl medcl deleted the refactor/fs_search_limit branch July 7, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants