diff --git a/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java index 54c93818864..03b6e554ca5 100644 --- a/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java +++ b/solr/src/java/org/apache/solr/search/SolrIndexSearcher.java @@ -656,7 +656,6 @@ public class SolrIndexSearcher extends IndexSearcher implements SolrInfoMBean { } } else { for (int docid = -1; (docid = idIter.advance(docid+1)) < max; ) { - if (skipDocs != null && skipDocs.get(docid)) continue; collector.collect(docid); } } diff --git a/solr/src/test/org/apache/solr/search/TestFiltering.java b/solr/src/test/org/apache/solr/search/TestFiltering.java index aebabeb333e..da23d148c6e 100644 --- a/solr/src/test/org/apache/solr/search/TestFiltering.java +++ b/solr/src/test/org/apache/solr/search/TestFiltering.java @@ -254,7 +254,8 @@ public class TestFiltering extends SolrTestCaseJ4 { } assertU(commit()); - + int totalMatches=0; + int nonZeros=0; for (int qiter=0; qiter params = new ArrayList(); @@ -295,6 +296,11 @@ public class TestFiltering extends SolrTestCaseJ4 { long expectedMultiSelect = model.multiSelect.cardinality(); long expectedFacetQuery = model.facetQuery.cardinality(); + totalMatches += expected; + if (expected > 0) { + nonZeros++; + } + if (iiter==-1 && qiter==-1) { // set breakpoint here to debug a specific issue System.out.println("request="+params); @@ -316,6 +322,11 @@ public class TestFiltering extends SolrTestCaseJ4 { } } + + // After making substantial changes to this test, make sure that we still get a + // decent number of queries that match some documents + // System.out.println("totalMatches=" + totalMatches + " nonZeroQueries="+nonZeros); + } }