diff --git a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java index 8b1584148d9..4618104875c 100644 --- a/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java +++ b/solr/core/src/java/org/apache/solr/search/CollapsingQParserPlugin.java @@ -305,8 +305,12 @@ public class CollapsingQParserPlugin extends QParserPlugin { int maxDoc = searcher.maxDoc(); int leafCount = searcher.getTopReaderContext().leaves().size(); - SolrRequestInfo info = SolrRequestInfo.getRequestInfo(); - this.boosted = (Set)info.getReq().getContext().get(QueryElevationComponent.BOOSTED); + if(this.boosted == null) { + SolrRequestInfo info = SolrRequestInfo.getRequestInfo(); + if(info != null) { + this.boosted = (Set)info.getReq().getContext().get(QueryElevationComponent.BOOSTED); + } + } IntOpenHashSet boostDocs = getBoostDocs(searcher, this.boosted);