Fix: Increment searches stat correctly during presearch phase#2188
Merged
Conversation
- 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.
Contributor
There was a problem hiding this comment.
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
previously approved these changes
Apr 28, 2025
Likith101
approved these changes
Apr 28, 2025
metonymic-smokey
approved these changes
Apr 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
searchesstat was only incremented at the end of the second phase in two-phase searches.searchesstat was not incremented.searchTimestat to ensure accurate values for both single-phase and two-phase searches.