DrillSidewaysScorer NPE if drill-down terms were not found

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1491809 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2013-06-11 14:21:12 +00:00
parent a287431293
commit 5a14c04bc1
1 changed files with 10 additions and 6 deletions

View File

@ -80,9 +80,11 @@ class DrillSidewaysScorer extends Scorer {
// Position all scorers to their first matching doc:
baseScorer.nextDoc();
for(DocsEnumsAndFreq dim : dims) {
for(DocsEnum docsEnum : dim.docsEnums) {
if (docsEnum != null) {
docsEnum.nextDoc();
if (dim.docsEnums != null) {
for (DocsEnum docsEnum : dim.docsEnums) {
if (docsEnum != null) {
docsEnum.nextDoc();
}
}
}
}
@ -95,9 +97,11 @@ class DrillSidewaysScorer extends Scorer {
for(int dim=0;dim<numDims;dim++) {
docsEnums[dim] = dims[dim].docsEnums;
sidewaysCollectors[dim] = dims[dim].sidewaysCollector;
for(DocsEnum de : dims[dim].docsEnums) {
if (de != null) {
drillDownCost += de.cost();
if (dims[dim].docsEnums != null) {
for (DocsEnum de : dims[dim].docsEnums) {
if (de != null) {
drillDownCost += de.cost();
}
}
}
}