Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-1459: BoostedQuery needs to handle when its wrapped query weight returns null for the scorer

Mark Robert Millere0eee44b641b
diff --git a/src/java/org/apache/solr/search/function/BoostedQuery.java b/src/java/org/apache/solr/search/function/BoostedQuery.java
index 08203a5f1b8..4bae945fc99 100755
--- a/src/java/org/apache/solr/search/function/BoostedQuery.java
+++ b/src/java/org/apache/solr/search/function/BoostedQuery.java
@@ -93,6 +93,9 @@ public class BoostedQuery extends Query {
@Override
public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
Scorer subQueryScorer = qWeight.scorer(reader, true, false);
+ if(subQueryScorer == null) {
+ return null;
+ }
return new BoostedQuery.CustomScorer(getSimilarity(searcher), searcher, reader, this, subQueryScorer, boostVal);
}