Skip to content

Fix: Increment searches stat correctly during presearch phase#2188

Merged
CascadingRadium merged 2 commits into
masterfrom
fixStat
Apr 28, 2025
Merged

Fix: Increment searches stat correctly during presearch phase#2188
CascadingRadium merged 2 commits into
masterfrom
fixStat

Conversation

@CascadingRadium

@CascadingRadium CascadingRadium commented Apr 27, 2025

Copy link
Copy Markdown
Member
  • Previously, the searches stat was only incremented at the end of the second phase in two-phase searches.
  • If the search request was satisfied during the presearch phase and the second phase was skipped, the searches stat was not incremented.
  • This PR fixes the issue by incrementing the stat at the end of the presearch phase itself, ensuring it correctly reflects the number of searches whether the request is satisfied in the first phase or requires both phases.
  • Also fixes the searchTime stat to ensure accurate values for both single-phase and two-phase searches.

- Previously, the `searches` stat was only incremented at the end of the second phase in two-phase searches.
- If the search request was satisfied during the presearch phase and the second phase was skipped, the `searches` stat was not incremented.
- This PR fixes the issue by incrementing the stat at the end of the presearch phase itself, ensuring it correctly reflects the number of searches whether the request is satisfied in the first phase or requires both phases.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where the "searches" stat was not incremented during the presearch phase. It ensures the stat is incremented immediately when the presearch phase completes and conditionally during the second-phase search for non-hybrid searches.

  • Increment the search stat during the presearch phase.
  • Conditionally increment the stat during the second-phase search based on req.PreSearchData.

Likith101
Likith101 previously approved these changes Apr 28, 2025
@CascadingRadium CascadingRadium merged commit 404e188 into master Apr 28, 2025
@CascadingRadium CascadingRadium deleted the fixStat branch April 28, 2025 04:35
@CascadingRadium CascadingRadium added this to the v2.5.1 milestone Apr 28, 2025
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.

4 participants