Apache Lucene 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.javaindex 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 {@Overridepublic 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);}