Skip to content

Conversation

@CascadingRadium
Copy link
Member

@CascadingRadium CascadingRadium commented Nov 26, 2025

  • ScoreBreakdown map was always getting created, and not being reused. When recycling the DocumentMatch, clear out the score breakdown map and reuse it when needed.
  • Fix dropped error when creating pre-filter searcher.
  • Close KNN and Pre-filter Searchers when done.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request optimizes memory allocation by reusing the ScoreBreakdown map across document matches instead of creating a new one each time. When a DocumentMatch is reset for reuse, the existing map is now preserved, cleared, and reassigned.

Key changes:

  • Modified DocumentMatch.Reset() to save, clear, and reuse the ScoreBreakdown map
  • Updated DisjunctionQueryScorer.ScoreAndExplBreakdown() to check if the map exists before initializing a new one

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
search/search.go Added logic to preserve and clear the ScoreBreakdown map during DocumentMatch reset for reuse
search/scorer/scorer_disjunction.go Refactored to reuse the existing ScoreBreakdown map if present instead of always creating a new one

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

CascadingRadium and others added 2 commits November 26, 2025 23:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@CascadingRadium CascadingRadium changed the title Reuse ScoreBreakdown Minor code fixes Nov 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

capemox
capemox previously approved these changes Dec 1, 2025
@abhinavdangeti abhinavdangeti added this to the v2.5.6 milestone Dec 1, 2025
abhinavdangeti
abhinavdangeti previously approved these changes Dec 1, 2025
@CascadingRadium CascadingRadium merged commit 9f1a70a into master Dec 2, 2025
9 checks passed
@CascadingRadium CascadingRadium deleted the scoreBreakdownOpt branch December 2, 2025 09:30
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.

5 participants