Skip to content

SOLR-18181: ValueSourceAugmenter NPE when rows exceed 1000 and scores requested#4314

Merged
mlbiscoc merged 2 commits intoapache:branch_9xfrom
mlbiscoc:SOLR-18181-npe
Apr 23, 2026
Merged

SOLR-18181: ValueSourceAugmenter NPE when rows exceed 1000 and scores requested#4314
mlbiscoc merged 2 commits intoapache:branch_9xfrom
mlbiscoc:SOLR-18181-npe

Conversation

@mlbiscoc
Copy link
Copy Markdown
Contributor

Trying to send a query with ValueSourceAugmenter that requested score and > 1000 rows resulted in an NPE. This is because when it passes prefetch limit and tries to retrieve score, it was referenced incorrectly.

ValueSourceAugmenter was overriding a deprecated 2-arg method which didn't have access to score. The method then incorrectly tried to get score via (float) doc.get("score")

To fix, we override the non-deprecated method instead which actually has DocIterationInfo to get the score.

Copy link
Copy Markdown
Contributor

@HoustonPutman HoustonPutman left a comment

Choose a reason for hiding this comment

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

Looks good, the change is already there in 10x, so this is just bringing 9x more in-line.

@mlbiscoc mlbiscoc merged commit 36b61d4 into apache:branch_9x Apr 23, 2026
5 checks passed
@@ -0,0 +1,7 @@
title: Fix NPE in ValueSourceAugmenter when rows exceed prefetch limit with scores requested
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.

End users (who generally aren't Solr hackers) have no idea what ValueSourceAugmenter even is; it's an internal thing. They do know about use of function queries in the "fl". In the changelog we should try to explain the impact when we can, like:

Use of function queries in "fl" would fail if rows exceeds 1000 and scores requested. A regression since v9.9.

Here, users would then see this for the serious regression that this is:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants