From abdb8e0e2f4e3974ee4a1176234e3727c8c95928 Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Tue, 28 Jun 2011 18:53:39 +0000 Subject: [PATCH] SOLR-2429: don't need to check deletions when iterating over filter git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1140786 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/search/SolrIndexSearcher.java | 1 - .../test/org/apache/solr/search/TestFiltering.java | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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); + } }