From a4fc20d91ece6b62bafda798f2773ad9bf1f5eb7 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 2 Jan 2012 16:16:34 +0000 Subject: [PATCH] LUCENE-3667: fix broken test optimization (when n > 1000) git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1226455 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/src/test/org/apache/lucene/index/TestIndexWriter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java index 1ca7ee697dc..0f1b108de69 100644 --- a/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/lucene/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -455,8 +455,8 @@ public class TestIndexWriter extends LuceneTestCase { IndexReader reader = IndexReader.open(dir); IndexSearcher searcher = new IndexSearcher(reader); - ScoreDoc[] hits = searcher.search(new TermQuery(new Term("field", "aaa")), null, 1000).scoreDocs; - assertEquals(n*100, hits.length); + int totalHits = searcher.search(new TermQuery(new Term("field", "aaa")), null, 1).totalHits; + assertEquals(n*100, totalHits); reader.close(); dir.close();