lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [30/36] lucene-solr:jira/http2: LUCENE-8430: TopDocs.totalHits may now be a lower bound of the hit count.
Date Tue, 31 Jul 2018 02:32:46 GMT
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java
index a8b6399..56c5f8a 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanRewrites.java
@@ -413,7 +413,7 @@ public class TestBooleanRewrites extends LuceneTestCase {
   }
 
   private void assertEquals(TopDocs td1, TopDocs td2) {
-    assertEquals(td1.totalHits, td2.totalHits);
+    assertEquals(td1.totalHits.value, td2.totalHits.value);
     assertEquals(td1.scoreDocs.length, td2.scoreDocs.length);
     Map<Integer, Float> expectedScores = Arrays.stream(td1.scoreDocs).collect(Collectors.toMap(sd -> sd.doc, sd -> sd.score));
     Set<Integer> actualResultSet = Arrays.stream(td2.scoreDocs).map(sd -> sd.doc).collect(Collectors.toSet());

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java b/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java
index 843c89b..4d3d8d8 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestBooleanScorer.java
@@ -149,7 +149,7 @@ public class TestBooleanScorer extends LuceneTestCase {
     q2.add(q1.build(), BooleanClause.Occur.SHOULD);
     q2.add(new CrazyMustUseBulkScorerQuery(), BooleanClause.Occur.SHOULD);
 
-    assertEquals(1, s.search(q2.build(), 10).totalHits);
+    assertEquals(1, s.search(q2.build(), 10).totalHits.value);
     r.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java b/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java
index cc4f7fe..ebe7887 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestConjunctions.java
@@ -79,7 +79,7 @@ public class TestConjunctions extends LuceneTestCase {
     bq.add(new TermQuery(new Term(F1, "nutch")), BooleanClause.Occur.MUST);
     bq.add(new TermQuery(new Term(F2, "is")), BooleanClause.Occur.MUST);
     TopDocs td = searcher.search(bq.build(), 3);
-    assertEquals(1, td.totalHits);
+    assertEquals(1, td.totalHits.value);
     assertEquals(3F, td.scoreDocs[0].score, 0.001F); // f1:nutch + f2:is + f2:is
   }
   

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
index c1157ff..c8f9c84 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestControlledRealTimeReopenThread.java
@@ -107,7 +107,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
         System.out.println(Thread.currentThread().getName() + ": nrt: got deletes searcher=" + s);
       }
       try {
-        assertEquals(docs.size(), s.search(new TermQuery(id), 10).totalHits);
+        assertEquals(docs.size(), s.search(new TermQuery(id), 10).totalHits.value);
       } finally {
         nrtDeletes.release(s);
       }
@@ -131,7 +131,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
         System.out.println(Thread.currentThread().getName() + ": nrt: got noDeletes searcher=" + s);
       }
       try {
-        assertEquals(docs.size(), s.search(new TermQuery(id), 10).totalHits);
+        assertEquals(docs.size(), s.search(new TermQuery(id), 10).totalHits.value);
       } finally {
         nrtNoDeletes.release(s);
       }
@@ -155,7 +155,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
         System.out.println(Thread.currentThread().getName() + ": nrt: got noDeletes searcher=" + s);
       }
       try {
-        assertEquals(1, s.search(new TermQuery(id), 10).totalHits);
+        assertEquals(1, s.search(new TermQuery(id), 10).totalHits.value);
       } finally {
         nrtNoDeletes.release(s);
       }
@@ -178,7 +178,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
         System.out.println(Thread.currentThread().getName() + ": nrt: got deletes searcher=" + s);
       }
       try {
-        assertEquals(1, s.search(new TermQuery(id), 10).totalHits);
+        assertEquals(1, s.search(new TermQuery(id), 10).totalHits.value);
       } finally {
         nrtDeletes.release(s);
       }
@@ -201,7 +201,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
         System.out.println(Thread.currentThread().getName() + ": nrt: got deletes searcher=" + s);
       }
       try {
-        assertEquals(0, s.search(new TermQuery(id), 10).totalHits);
+        assertEquals(0, s.search(new TermQuery(id), 10).totalHits.value);
       } finally {
         nrtDeletes.release(s);
       }
@@ -524,7 +524,7 @@ public class TestControlledRealTimeReopenThread extends ThreadedIndexingAndSearc
       IndexSearcher searcher = sm.acquire();
       TopDocs td = searcher.search(new TermQuery(new Term("count", i + "")), 10);
       sm.release(searcher);
-      assertEquals(1, td.totalHits);
+      assertEquals(1, td.totalHits.value);
     }
 
     for(Thread commitThread : commitThreads) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java
index d70c09d..0664709 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestDocValuesQueries.java
@@ -175,7 +175,7 @@ public class TestDocValuesQueries extends LuceneTestCase {
     final int maxDoc = searcher.getIndexReader().maxDoc();
     final TopDocs td1 = searcher.search(q1, maxDoc, scores ? Sort.RELEVANCE : Sort.INDEXORDER);
     final TopDocs td2 = searcher.search(q2, maxDoc, scores ? Sort.RELEVANCE : Sort.INDEXORDER);
-    assertEquals(td1.totalHits, td2.totalHits);
+    assertEquals(td1.totalHits.value, td2.totalHits.value);
     for (int i = 0; i < td1.scoreDocs.length; ++i) {
       assertEquals(td1.scoreDocs[i].doc, td2.scoreDocs[i].doc);
       if (scores) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java b/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java
index 9806add..e300cf7 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestDoubleValuesSource.java
@@ -169,7 +169,7 @@ public class TestDoubleValuesSource extends LuceneTestCase {
 
     CheckHits.checkEqual(query, expected.scoreDocs, actual.scoreDocs);
 
-    if (size < actual.totalHits) {
+    if (size < actual.totalHits.value) {
       expected = searcher.searchAfter(expected.scoreDocs[size-1], query, size, sort);
       actual = searcher.searchAfter(actual.scoreDocs[size-1], query, size, mutatedSort);
       CheckHits.checkEqual(query, expected.scoreDocs, actual.scoreDocs);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestFieldValueQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFieldValueQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestFieldValueQuery.java
index f5d46e9..53ea61d 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestFieldValueQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestFieldValueQuery.java
@@ -202,7 +202,7 @@ public class TestFieldValueQuery extends LuceneTestCase {
     final int maxDoc = searcher.getIndexReader().maxDoc();
     final TopDocs td1 = searcher.search(q1, maxDoc, scores ? Sort.RELEVANCE : Sort.INDEXORDER);
     final TopDocs td2 = searcher.search(q2, maxDoc, scores ? Sort.RELEVANCE : Sort.INDEXORDER);
-    assertEquals(td1.totalHits, td2.totalHits);
+    assertEquals(td1.totalHits.value, td2.totalHits.value);
     for (int i = 0; i < td1.scoreDocs.length; ++i) {
       assertEquals(td1.scoreDocs[i].doc, td2.scoreDocs[i].doc);
       if (scores) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
index ebaf3c0..024abc3 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestFuzzyQuery.java
@@ -367,7 +367,7 @@ public class TestFuzzyQuery extends LuceneTestCase {
     IndexSearcher searcher = newSearcher(mr);
     FuzzyQuery fq = new FuzzyQuery(new Term("field", "z123456"), 1, 0, 2, false);
     TopDocs docs = searcher.search(fq, 2);
-    assertEquals(5, docs.totalHits); // 5 docs, from the a and b's
+    assertEquals(5, docs.totalHits.value); // 5 docs, from the a and b's
     mr.close();
     ir1.close();
     ir2.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java b/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
index 37f90de..7e4c3c2 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestIndexSearcher.java
@@ -165,7 +165,7 @@ public class TestIndexSearcher extends LuceneTestCase {
             .add(new TermQuery(new Term("foo", "baz")), Occur.SHOULD)
             .build()
           )) {
-        assertEquals(searcher.count(query), searcher.search(query, 1).totalHits);
+        assertEquals(searcher.count(query), searcher.search(query, 1).totalHits.value);
       }
       reader.close();
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java b/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
index 8443d86..a30e026 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestLRUQueryCache.java
@@ -148,7 +148,7 @@ public class TestLRUQueryCache extends LuceneTestCase {
                 TotalHitCountCollector collector = new TotalHitCountCollector();
                 searcher.search(q, collector); // will use the cache
                 final int totalHits1 = collector.getTotalHits();
-                final long totalHits2 = searcher.search(q, 1).totalHits; // will not use the cache because of scores
+                final long totalHits2 = searcher.search(q, 1).totalHits.value; // will not use the cache because of scores
                 assertEquals(totalHits2, totalHits1);
               } finally {
                 mgr.release(searcher);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java
index 9346428..b0440fa 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestLiveFieldValues.java
@@ -62,8 +62,8 @@ public class TestLiveFieldValues extends LuceneTestCase {
         protected Integer lookupFromSearcher(IndexSearcher s, String id) throws IOException {
           TermQuery tq = new TermQuery(new Term("id", id));
           TopDocs hits = s.search(tq, 1);
-          assertTrue(hits.totalHits <= 1);
-          if (hits.totalHits == 0) {
+          assertTrue(hits.totalHits.value <= 1);
+          if (hits.totalHits.value == 0) {
             return null;
           } else {
             Document doc = s.doc(hits.scoreDocs[0].doc);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java b/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java
index f33292d..dd6694e 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestLongValuesSource.java
@@ -141,7 +141,7 @@ public class TestLongValuesSource extends LuceneTestCase {
 
     CheckHits.checkEqual(query, expected.scoreDocs, actual.scoreDocs);
 
-    if (size < actual.totalHits) {
+    if (size < actual.totalHits.value) {
       expected = searcher.searchAfter(expected.scoreDocs[size-1], query, size, sort);
       actual = searcher.searchAfter(actual.scoreDocs[size-1], query, size, mutatedSort);
       CheckHits.checkEqual(query, expected.scoreDocs, actual.scoreDocs);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
index 4193796..3d481ba 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
@@ -376,10 +376,10 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
       mpqb.add(new Term[] {new Term("field", "b"), new Term("field", "c")}, 0);
     }
     TopDocs hits = s.search(mpqb.build(), 2);
-    assertEquals(2, hits.totalHits);
+    assertEquals(2, hits.totalHits.value);
     assertEquals(hits.scoreDocs[0].score, hits.scoreDocs[1].score, 1e-5);
     /*
-    for(int hit=0;hit<hits.totalHits;hit++) {
+    for(int hit=0;hit<hits.totalHits.value;hit++) {
       ScoreDoc sd = hits.scoreDocs[hit];
       System.out.println("  hit doc=" + sd.doc + " score=" + sd.score);
     }
@@ -463,10 +463,10 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
     }
     
     TopDocs hits = s.search(q, 1);
-    assertEquals("wrong number of results", nExpected, hits.totalHits);
+    assertEquals("wrong number of results", nExpected, hits.totalHits.value);
     
     if (VERBOSE) {
-      for(int hit=0;hit<hits.totalHits;hit++) {
+      for(int hit=0;hit<hits.totalHits.value;hit++) {
         ScoreDoc sd = hits.scoreDocs[hit];
         System.out.println("  hit doc=" + sd.doc + " score=" + sd.score);
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java b/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java
index 9352f72..88860c0 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestNeedsScores.java
@@ -64,26 +64,26 @@ public class TestNeedsScores extends LuceneTestCase {
     BooleanQuery.Builder bq = new BooleanQuery.Builder();
     bq.add(new AssertNeedsScores(required, ScoreMode.COMPLETE), BooleanClause.Occur.MUST);
     bq.add(new AssertNeedsScores(prohibited, ScoreMode.COMPLETE_NO_SCORES), BooleanClause.Occur.MUST_NOT);
-    assertEquals(4, searcher.search(bq.build(), 5).totalHits); // we exclude 3
+    assertEquals(4, searcher.search(bq.build(), 5).totalHits.value); // we exclude 3
   }
   
   /** nested inside constant score query */
   public void testConstantScoreQuery() throws Exception {
     Query term = new TermQuery(new Term("field", "this"));
     Query constantScore = new ConstantScoreQuery(new AssertNeedsScores(term, ScoreMode.COMPLETE_NO_SCORES));
-    assertEquals(5, searcher.search(constantScore, 5).totalHits);
+    assertEquals(5, searcher.search(constantScore, 5).totalHits.value);
   }
   
   /** when not sorting by score */
   public void testSortByField() throws Exception {
     Query query = new AssertNeedsScores(new MatchAllDocsQuery(), ScoreMode.COMPLETE_NO_SCORES);
-    assertEquals(5, searcher.search(query, 5, Sort.INDEXORDER).totalHits);
+    assertEquals(5, searcher.search(query, 5, Sort.INDEXORDER).totalHits.value);
   }
   
   /** when sorting by score */
   public void testSortByScore() throws Exception {
     Query query = new AssertNeedsScores(new MatchAllDocsQuery(), ScoreMode.COMPLETE);
-    assertEquals(5, searcher.search(query, 5, Sort.RELEVANCE).totalHits);
+    assertEquals(5, searcher.search(query, 5, Sort.RELEVANCE).totalHits.value);
   }
 
   /** 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java
index 75c0c45..72b5802 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestNormsFieldExistsQuery.java
@@ -186,7 +186,7 @@ public class TestNormsFieldExistsQuery extends LuceneTestCase {
     final int maxDoc = searcher.getIndexReader().maxDoc();
     final TopDocs td1 = searcher.search(q1, maxDoc, scores ? Sort.RELEVANCE : Sort.INDEXORDER);
     final TopDocs td2 = searcher.search(q2, maxDoc, scores ? Sort.RELEVANCE : Sort.INDEXORDER);
-    assertEquals(td1.totalHits, td2.totalHits);
+    assertEquals(td1.totalHits.value, td2.totalHits.value);
     for (int i = 0; i < td1.scoreDocs.length; ++i) {
       assertEquals(td1.scoreDocs[i].doc, td2.scoreDocs[i].doc);
       if (scores) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
index 9fbd6a4..5860e8f 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java
@@ -108,7 +108,7 @@ public class TestPositiveScoresOnlyCollector extends LuceneTestCase {
     }
     TopDocs td = tdc.topDocs();
     ScoreDoc[] sd = td.scoreDocs;
-    assertEquals(numPositiveScores, td.totalHits);
+    assertEquals(numPositiveScores, td.totalHits.value);
     for (int i = 0; i < sd.length; i++) {
       assertTrue("only positive scores should return: " + sd[i].score, sd[i].score > 0);
     }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java
index d33bdaf..c9f723b 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java
@@ -85,12 +85,12 @@ public class TestPrefixInBooleanQuery extends LuceneTestCase {
   public void testPrefixQuery() throws Exception {
     Query query = new PrefixQuery(new Term(FIELD, "tang"));
     assertEquals("Number of matched documents", 2,
-                 searcher.search(query, 1000).totalHits);
+                 searcher.search(query, 1000).totalHits.value);
   }
   public void testTermQuery() throws Exception {
     Query query = new TermQuery(new Term(FIELD, "tangfulin"));
     assertEquals("Number of matched documents", 2,
-                 searcher.search(query, 1000).totalHits);
+                 searcher.search(query, 1000).totalHits.value);
   }
   public void testTermBooleanQuery() throws Exception {
     BooleanQuery.Builder query = new BooleanQuery.Builder();
@@ -99,7 +99,7 @@ public class TestPrefixInBooleanQuery extends LuceneTestCase {
     query.add(new TermQuery(new Term(FIELD, "notexistnames")),
               BooleanClause.Occur.SHOULD);
     assertEquals("Number of matched documents", 2,
-                 searcher.search(query.build(), 1000).totalHits);
+                 searcher.search(query.build(), 1000).totalHits.value);
 
   }
   public void testPrefixBooleanQuery() throws Exception {
@@ -109,6 +109,6 @@ public class TestPrefixInBooleanQuery extends LuceneTestCase {
     query.add(new TermQuery(new Term(FIELD, "notexistnames")),
               BooleanClause.Occur.SHOULD);
     assertEquals("Number of matched documents", 2,
-                 searcher.search(query.build(), 1000).totalHits);
+                 searcher.search(query.build(), 1000).totalHits.value);
   }
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java
index b5c5ca1..2395d0b 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestPrefixQuery.java
@@ -83,7 +83,7 @@ public class TestPrefixQuery extends LuceneTestCase {
     PrefixQuery query = new PrefixQuery(new Term("field", ""));
     IndexSearcher searcher = newSearcher(reader);
 
-    assertEquals(1, searcher.search(query, 1000).totalHits);
+    assertEquals(1, searcher.search(query, 1000).totalHits.value);
     writer.close();
     reader.close();
     directory.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java b/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
index d1f307d..8bbfeb5 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestQueryRescorer.java
@@ -79,7 +79,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     searcher.setSimilarity(new ClassicSimilarity());
 
     TopDocs hits = searcher.search(bq.build(), 10);
-    assertEquals(2, hits.totalHits);
+    assertEquals(2, hits.totalHits.value);
     assertEquals("0", searcher.doc(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(hits.scoreDocs[1].doc).get("id"));
 
@@ -89,7 +89,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     TopDocs hits2 = QueryRescorer.rescore(searcher, hits, pq, 2.0, 10);
 
     // Resorting changed the order:
-    assertEquals(2, hits2.totalHits);
+    assertEquals(2, hits2.totalHits.value);
     assertEquals("1", searcher.doc(hits2.scoreDocs[0].doc).get("id"));
     assertEquals("0", searcher.doc(hits2.scoreDocs[1].doc).get("id"));
 
@@ -101,7 +101,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     TopDocs hits3 = QueryRescorer.rescore(searcher, hits, snq, 2.0, 10);
 
     // Resorting changed the order:
-    assertEquals(2, hits3.totalHits);
+    assertEquals(2, hits3.totalHits.value);
     assertEquals("1", searcher.doc(hits3.scoreDocs[0].doc).get("id"));
     assertEquals("0", searcher.doc(hits3.scoreDocs[1].doc).get("id"));
 
@@ -134,7 +134,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     searcher.setSimilarity(new ClassicSimilarity());
 
     TopDocs hits = searcher.search(bq.build(), 10);
-    assertEquals(2, hits.totalHits);
+    assertEquals(2, hits.totalHits.value);
     assertEquals("0", searcher.doc(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(hits.scoreDocs[1].doc).get("id"));
 
@@ -143,7 +143,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     TopDocs hits2 = QueryRescorer.rescore(searcher, hits, tq, 2.0, 10);
 
     // Just testing that null scorer is handled.
-    assertEquals(2, hits2.totalHits);
+    assertEquals(2, hits2.totalHits.value);
 
     r.close();
     dir.close();
@@ -172,7 +172,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     IndexSearcher searcher = getSearcher(r);
 
     TopDocs hits = searcher.search(bq.build(), 10);
-    assertEquals(2, hits.totalHits);
+    assertEquals(2, hits.totalHits.value);
     assertEquals("0", searcher.doc(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(hits.scoreDocs[1].doc).get("id"));
 
@@ -192,7 +192,7 @@ public class TestQueryRescorer extends LuceneTestCase {
       }.rescore(searcher, hits, 10);
 
     // Resorting didn't change the order:
-    assertEquals(2, hits2.totalHits);
+    assertEquals(2, hits2.totalHits.value);
     assertEquals("0", searcher.doc(hits2.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(hits2.scoreDocs[1].doc).get("id"));
 
@@ -223,7 +223,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     IndexSearcher searcher = getSearcher(r);
 
     TopDocs hits = searcher.search(bq.build(), 10);
-    assertEquals(2, hits.totalHits);
+    assertEquals(2, hits.totalHits.value);
     assertEquals("0", searcher.doc(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(hits.scoreDocs[1].doc).get("id"));
 
@@ -244,7 +244,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     TopDocs hits2 = rescorer.rescore(searcher, hits, 10);
 
     // Resorting changed the order:
-    assertEquals(2, hits2.totalHits);
+    assertEquals(2, hits2.totalHits.value);
     assertEquals("1", searcher.doc(hits2.scoreDocs[0].doc).get("id"));
     assertEquals("0", searcher.doc(hits2.scoreDocs[1].doc).get("id"));
 
@@ -298,7 +298,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     IndexSearcher searcher = getSearcher(r);
 
     TopDocs hits = searcher.search(bq.build(), 10);
-    assertEquals(2, hits.totalHits);
+    assertEquals(2, hits.totalHits.value);
     assertEquals("0", searcher.doc(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(hits.scoreDocs[1].doc).get("id"));
 
@@ -308,7 +308,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     TopDocs hits2 = QueryRescorer.rescore(searcher, hits, pq, 2.0, 10);
 
     // Resorting changed the order:
-    assertEquals(2, hits2.totalHits);
+    assertEquals(2, hits2.totalHits.value);
     assertEquals("1", searcher.doc(hits2.scoreDocs[0].doc).get("id"));
     assertEquals("0", searcher.doc(hits2.scoreDocs[1].doc).get("id"));
 
@@ -320,7 +320,7 @@ public class TestQueryRescorer extends LuceneTestCase {
     TopDocs hits3 = QueryRescorer.rescore(searcher, hits, snq, 2.0, 10);
 
     // Resorting changed the order:
-    assertEquals(2, hits3.totalHits);
+    assertEquals(2, hits3.totalHits.value);
     assertEquals("1", searcher.doc(hits3.scoreDocs[0].doc).get("id"));
     assertEquals("0", searcher.doc(hits3.scoreDocs[1].doc).get("id"));
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java
index ad1319b..6a8e183 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpQuery.java
@@ -70,7 +70,7 @@ public class TestRegexpQuery extends LuceneTestCase {
   
   private long regexQueryNrHits(String regex) throws IOException {
     RegexpQuery query = new RegexpQuery(newTerm(regex));
-    return searcher.search(query, 5).totalHits;
+    return searcher.count(query);
   }
   
   public void testRegex1() throws IOException {
@@ -112,7 +112,7 @@ public class TestRegexpQuery extends LuceneTestCase {
     };
     RegexpQuery query = new RegexpQuery(newTerm("<quickBrown>"), RegExp.ALL,
       myProvider, DEFAULT_MAX_DETERMINIZED_STATES);
-    assertEquals(1, searcher.search(query, 5).totalHits);
+    assertEquals(1, searcher.search(query, 5).totalHits.value);
   }
   
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java
index e16a426..45bd625 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestRegexpRandom.java
@@ -90,7 +90,7 @@ public class TestRegexpRandom extends LuceneTestCase {
   private void assertPatternHits(String pattern, int numHits) throws Exception {
     Query wq = new RegexpQuery(new Term("field", fillPattern(pattern)));
     TopDocs docs = searcher.search(wq, 25);
-    assertEquals("Incorrect hits for pattern: " + pattern, numHits, docs.totalHits);
+    assertEquals("Incorrect hits for pattern: " + pattern, numHits, docs.totalHits.value);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java b/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java
index 88f92a5..efb7e5e 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSameScoresWithThreads.java
@@ -97,7 +97,7 @@ public class TestSameScoresWithThreads extends LuceneTestCase {
                   for(Map.Entry<BytesRef,TopDocs> ent : shuffled) {
                     TopDocs actual = s.search(new TermQuery(new Term("body", ent.getKey())), 100);
                     TopDocs expected = ent.getValue();
-                    assertEquals(expected.totalHits, actual.totalHits);
+                    assertEquals(expected.totalHits.value, actual.totalHits.value);
                     assertEquals("query=" + ent.getKey().utf8ToString(), expected.scoreDocs.length, actual.scoreDocs.length);
                     for(int hit=0;hit<expected.scoreDocs.length;hit++) {
                       assertEquals(expected.scoreDocs[hit].doc, actual.scoreDocs[hit].doc);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java b/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java
index 363c974..4d95c87 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java
@@ -225,7 +225,7 @@ public class TestSearchAfter extends LuceneTestCase {
       all = searcher.search(query, maxDoc, sort, doScores);
     }
     if (VERBOSE) {
-      System.out.println("  all.totalHits=" + all.totalHits);
+      System.out.println("  all.totalHits.value=" + all.totalHits.value);
       int upto = 0;
       for(ScoreDoc scoreDoc : all.scoreDocs) {
         System.out.println("    hit " + (upto++) + ": id=" + searcher.doc(scoreDoc.doc).get("id") + " " + scoreDoc);
@@ -233,7 +233,7 @@ public class TestSearchAfter extends LuceneTestCase {
     }
     int pageStart = 0;
     ScoreDoc lastBottom = null;
-    while (pageStart < all.totalHits) {
+    while (pageStart < all.totalHits.value) {
       TopDocs paged;
       if (sort == null) {
         if (VERBOSE) {
@@ -265,7 +265,7 @@ public class TestSearchAfter extends LuceneTestCase {
   }
 
   void assertPage(int pageStart, TopDocs all, TopDocs paged) throws IOException {
-    assertEquals(all.totalHits, paged.totalHits);
+    assertEquals(all.totalHits.value, paged.totalHits.value);
     for (int i = 0; i < paged.scoreDocs.length; i++) {
       ScoreDoc sd1 = all.scoreDocs[pageStart + i];
       ScoreDoc sd2 = paged.scoreDocs[i];

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java b/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java
index df34107..043c943 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestShardSearching.java
@@ -328,12 +328,12 @@ public class TestShardSearching extends ShardSearchingTestBase {
         System.out.println("  shard=" + shardID + " maxDoc=" + shardSearchers[shardID].searcher.getIndexReader().maxDoc());
       }
       */
-      System.out.println("  single searcher: " + hits.totalHits);
+      System.out.println("  single searcher: " + hits.totalHits.value);
       for(int i=0;i<hits.scoreDocs.length;i++) {
         final ScoreDoc sd = hits.scoreDocs[i];
         System.out.println("    doc=" + sd.doc + " score=" + sd.score);
       }
-      System.out.println("  shard searcher: " + shardHits.totalHits);
+      System.out.println("  shard searcher: " + shardHits.totalHits.value);
       for(int i=0;i<shardHits.scoreDocs.length;i++) {
         final ScoreDoc sd = shardHits.scoreDocs[i];
         System.out.println("    doc=" + sd.doc + " (rebased: " + (sd.doc + base[sd.shardIndex]) + ") score=" + sd.score + " shard=" + sd.shardIndex);
@@ -355,7 +355,7 @@ public class TestShardSearching extends ShardSearchingTestBase {
     final ScoreDoc bottomHit;
     final ScoreDoc bottomHitShards;
 
-    if (numHitsPaged < hits.totalHits) {
+    if (numHitsPaged < hits.totalHits.value) {
       // More hits to page through
       moreHits = true;
       if (sort == null) {
@@ -372,7 +372,7 @@ public class TestShardSearching extends ShardSearchingTestBase {
       }
 
     } else {
-      assertEquals(hits.totalHits, numHitsPaged);
+      assertEquals(hits.totalHits.value, numHitsPaged);
       bottomHit = null;
       bottomHitShards = null;
       moreHits = false;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java b/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
index 15411c4..ec59e58 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSimilarityProvider.java
@@ -82,9 +82,9 @@ public class TestSimilarityProvider extends LuceneTestCase {
 
     // sanity check of searching
     TopDocs foodocs = searcher.search(new TermQuery(new Term("foo", "brown")), 10);
-    assertTrue(foodocs.totalHits > 0);
+    assertTrue(foodocs.totalHits.value > 0);
     TopDocs bardocs = searcher.search(new TermQuery(new Term("bar", "brown")), 10);
-    assertTrue(bardocs.totalHits > 0);
+    assertTrue(bardocs.totalHits.value > 0);
     assertTrue(foodocs.scoreDocs[0].score < bardocs.scoreDocs[0].score);
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java
index bee5126..2fd22a0 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java
@@ -261,13 +261,13 @@ public class TestSloppyPhraseQuery extends LuceneTestCase {
     builder.add(new Term("lyrics", "drug"), 4);
     PhraseQuery pq = builder.build();
     // "drug the drug"~1
-    assertEquals(1, is.search(pq, 4).totalHits);
+    assertEquals(1, is.search(pq, 4).totalHits.value);
     builder.setSlop(1);
     pq = builder.build();
-    assertEquals(3, is.search(pq, 4).totalHits);
+    assertEquals(3, is.search(pq, 4).totalHits.value);
     builder.setSlop(2);
     pq = builder.build();
-    assertEquals(4, is.search(pq, 4).totalHits);
+    assertEquals(4, is.search(pq, 4).totalHits.value);
     ir.close();
     dir.close();
   }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSort.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSort.java b/lucene/core/src/test/org/apache/lucene/search/TestSort.java
index 2543c1b..d37c98dd 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSort.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSort.java
@@ -102,7 +102,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.STRING));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'foo'
     assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -130,7 +130,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.STRING, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'foo' comes after 'bar' in reverse order
     assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -158,7 +158,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.STRING_VAL));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'foo'
     assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -186,7 +186,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.STRING_VAL, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'foo' comes after 'bar' in reverse order
     assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -214,7 +214,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.STRING_VAL));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'foo'
     assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("foo", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -242,7 +242,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.STRING_VAL, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'foo' comes after 'bar' in reverse order
     assertEquals("foo", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -274,7 +274,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.INT));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // numeric order
     assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -307,7 +307,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.INT, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // reverse numeric order
     assertEquals("300000", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -338,7 +338,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.INT));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null is treated as a 0
     assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -371,7 +371,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null is treated as a Integer.MAX_VALUE
     assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -404,7 +404,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.LONG));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // numeric order
     assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -437,7 +437,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.LONG, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // reverse numeric order
     assertEquals("3000000000", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -468,7 +468,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.LONG));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null is treated as 0
     assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -501,7 +501,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null is treated as Long.MAX_VALUE
     assertEquals("-1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -534,7 +534,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.FLOAT));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // numeric order
     assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -567,7 +567,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.FLOAT, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // reverse numeric order
     assertEquals("30.1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -598,7 +598,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.FLOAT));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null is treated as 0
     assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -631,7 +631,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null is treated as Float.MAX_VALUE
     assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4.2", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -668,7 +668,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.DOUBLE));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(4, td.totalHits);
+    assertEquals(4, td.totalHits.value);
     // numeric order
     assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -699,7 +699,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.DOUBLE));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // numeric order
     assertEquals("-0", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("+0", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -735,7 +735,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.DOUBLE, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(4, td.totalHits);
+    assertEquals(4, td.totalHits.value);
     // numeric order
     assertEquals("30.1", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4.2333333333333", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -771,7 +771,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(new SortField("value", SortField.Type.DOUBLE));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(4, td.totalHits);
+    assertEquals(4, td.totalHits.value);
     // null treated as a 0
     assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertNull(searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -809,7 +809,7 @@ public class TestSort extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(4, td.totalHits);
+    assertEquals(4, td.totalHits.value);
     // null treated as Double.MAX_VALUE
     assertEquals("-1.3", searcher.doc(td.scoreDocs[0].doc).get("value"));
     assertEquals("4.2333333333332", searcher.doc(td.scoreDocs[1].doc).get("value"));
@@ -857,7 +857,7 @@ public class TestSort extends LuceneTestCase {
         new SortField("value2", SortField.Type.LONG));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(4, td.totalHits);
+    assertEquals(4, td.totalHits.value);
     // 'bar' comes before 'foo'
     assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value1"));
     assertEquals("bar", searcher.doc(td.scoreDocs[1].doc).get("value1"));
@@ -871,7 +871,7 @@ public class TestSort extends LuceneTestCase {
 
     // Now with overflow
     td = searcher.search(new MatchAllDocsQuery(), 1, sort);
-    assertEquals(4, td.totalHits);
+    assertEquals(4, td.totalHits.value);
     assertEquals("bar", searcher.doc(td.scoreDocs[0].doc).get("value1"));
     assertEquals("0", searcher.doc(td.scoreDocs[0].doc).get("value2"));
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java b/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
index 1055259..a60ed49 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSortRescorer.java
@@ -84,7 +84,7 @@ public class TestSortRescorer extends LuceneTestCase {
 
     // Just first pass query
     TopDocs hits = searcher.search(query, 10);
-    assertEquals(3, hits.totalHits);
+    assertEquals(3, hits.totalHits.value);
     assertEquals("3", r.document(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", r.document(hits.scoreDocs[1].doc).get("id"));
     assertEquals("2", r.document(hits.scoreDocs[2].doc).get("id"));
@@ -93,7 +93,7 @@ public class TestSortRescorer extends LuceneTestCase {
     Sort sort = new Sort(new SortField("popularity", SortField.Type.INT, true));
     Rescorer rescorer = new SortRescorer(sort);
     hits = rescorer.rescore(searcher, hits, 10);
-    assertEquals(3, hits.totalHits);
+    assertEquals(3, hits.totalHits.value);
     assertEquals("2", r.document(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", r.document(hits.scoreDocs[1].doc).get("id"));
     assertEquals("3", r.document(hits.scoreDocs[2].doc).get("id"));
@@ -119,7 +119,7 @@ public class TestSortRescorer extends LuceneTestCase {
 
     // Just first pass query
     TopDocs hits = searcher.search(query, 10);
-    assertEquals(3, hits.totalHits);
+    assertEquals(3, hits.totalHits.value);
     assertEquals("3", r.document(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", r.document(hits.scoreDocs[1].doc).get("id"));
     assertEquals("2", r.document(hits.scoreDocs[2].doc).get("id"));
@@ -130,7 +130,7 @@ public class TestSortRescorer extends LuceneTestCase {
     Sort sort = new Sort(source.getSortField(true));
     Rescorer rescorer = new SortRescorer(sort);
     hits = rescorer.rescore(searcher, hits, 10);
-    assertEquals(3, hits.totalHits);
+    assertEquals(3, hits.totalHits.value);
     assertEquals("2", r.document(hits.scoreDocs[0].doc).get("id"));
     assertEquals("1", r.document(hits.scoreDocs[1].doc).get("id"));
     assertEquals("3", r.document(hits.scoreDocs[2].doc).get("id"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java b/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java
index 37fb710..4aed297 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSortedNumericSortField.java
@@ -37,13 +37,13 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort();
     sort.setSort(new SortedNumericSortField("sortednumeric", SortField.Type.LONG));
     TopDocs td = empty.search(query, 10, sort, true);
-    assertEquals(0, td.totalHits);
+    assertEquals(0, td.totalHits.value);
     
     // for an empty index, any selector should work
     for (SortedNumericSelector.Type v : SortedNumericSelector.Type.values()) {
       sort.setSort(new SortedNumericSortField("sortednumeric", SortField.Type.LONG, false, v));
       td = empty.search(query, 10, sort, true);
-      assertEquals(0, td.totalHits);
+      assertEquals(0, td.totalHits.value);
     }
   }
   
@@ -83,7 +83,7 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedNumericSortField("value", SortField.Type.INT));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 3 comes before 5
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -112,7 +112,7 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedNumericSortField("value", SortField.Type.INT, true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("2", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -145,7 +145,7 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // 3 comes before 5
     // null comes first
     assertEquals("3", searcher.doc(td.scoreDocs[0].doc).get("id"));
@@ -180,7 +180,7 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // 3 comes before 5
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -209,7 +209,7 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedNumericSortField("value", SortField.Type.INT));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 3 comes before 5
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -237,7 +237,7 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedNumericSortField("value", SortField.Type.FLOAT));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // -5 comes before -3
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -265,7 +265,7 @@ public class TestSortedNumericSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedNumericSortField("value", SortField.Type.DOUBLE));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // -5 comes before -3
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java
index 16daf2b..faff910 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSelector.java
@@ -53,7 +53,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false, SortedSetSelector.Type.MAX));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'baz' comes before 'foo'
     assertEquals("2", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -83,7 +83,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", true, SortedSetSelector.Type.MAX));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'baz' comes before 'foo'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -118,7 +118,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null comes first
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     // 'baz' comes before 'foo'
@@ -155,7 +155,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // 'baz' comes before 'foo'
     assertEquals("3", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -185,7 +185,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false, SortedSetSelector.Type.MAX));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -216,7 +216,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false, SortedSetSelector.Type.MIDDLE_MIN));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'b' comes before 'c'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -247,7 +247,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", true, SortedSetSelector.Type.MIDDLE_MIN));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'b' comes before 'c'
     assertEquals("2", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -283,7 +283,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null comes first
     assertEquals("3", searcher.doc(td.scoreDocs[0].doc).get("id"));
     // 'b' comes before 'c'
@@ -321,7 +321,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // 'b' comes before 'c'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -351,7 +351,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false, SortedSetSelector.Type.MIDDLE_MIN));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -382,7 +382,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false, SortedSetSelector.Type.MIDDLE_MAX));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'b' comes before 'c'
     assertEquals("2", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -413,7 +413,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", true, SortedSetSelector.Type.MIDDLE_MAX));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'b' comes before 'c'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -449,7 +449,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // null comes first
     assertEquals("3", searcher.doc(td.scoreDocs[0].doc).get("id"));
     // 'b' comes before 'c'
@@ -487,7 +487,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // 'b' comes before 'c'
     assertEquals("2", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -517,7 +517,7 @@ public class TestSortedSetSelector extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false, SortedSetSelector.Type.MIDDLE_MAX));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java
index 899e46d..d585128 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSortedSetSortField.java
@@ -38,13 +38,13 @@ public class TestSortedSetSortField extends LuceneTestCase {
     Sort sort = new Sort();
     sort.setSort(new SortedSetSortField("sortedset", false));
     TopDocs td = empty.search(query, 10, sort, true);
-    assertEquals(0, td.totalHits);
+    assertEquals(0, td.totalHits.value);
     
     // for an empty index, any selector should work
     for (SortedSetSelector.Type v : SortedSetSelector.Type.values()) {
       sort.setSort(new SortedSetSortField("sortedset", false, v));
       td = empty.search(query, 10, sort, true);
-      assertEquals(0, td.totalHits);
+      assertEquals(0, td.totalHits.value);
     }
   }
   
@@ -83,7 +83,7 @@ public class TestSortedSetSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -112,7 +112,7 @@ public class TestSortedSetSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", true));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("2", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("1", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -145,7 +145,7 @@ public class TestSortedSetSortField extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // 'bar' comes before 'baz'
     // null comes first
     assertEquals("3", searcher.doc(td.scoreDocs[0].doc).get("id"));
@@ -180,7 +180,7 @@ public class TestSortedSetSortField extends LuceneTestCase {
     Sort sort = new Sort(sortField);
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(3, td.totalHits);
+    assertEquals(3, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));
@@ -209,7 +209,7 @@ public class TestSortedSetSortField extends LuceneTestCase {
     Sort sort = new Sort(new SortedSetSortField("value", false));
 
     TopDocs td = searcher.search(new MatchAllDocsQuery(), 10, sort);
-    assertEquals(2, td.totalHits);
+    assertEquals(2, td.totalHits.value);
     // 'bar' comes before 'baz'
     assertEquals("1", searcher.doc(td.scoreDocs[0].doc).get("id"));
     assertEquals("2", searcher.doc(td.scoreDocs[1].doc).get("id"));

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
index 44f915e..6165a1f 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java
@@ -92,7 +92,7 @@ public class TestSynonymQuery extends LuceneTestCase {
     searcher.search(query, collector);
     TopDocs topDocs = collector.topDocs();
     if (trackTotalHits) {
-      assertEquals(11, topDocs.totalHits);
+      assertEquals(11, topDocs.totalHits.value);
     }
     // All docs must have the same score
     for (int i = 0; i < topDocs.scoreDocs.length; ++i) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java b/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java
index be59eb9..892508b 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTermRangeQuery.java
@@ -271,7 +271,7 @@ public class TestTermRangeQuery extends LuceneTestCase {
     initializeIndex(new String[] {"A", "B", "", "C", "D"}, analyzer);
     IndexReader reader = DirectoryReader.open(dir);
     IndexSearcher searcher = newSearcher(reader);
-    long numHits = searcher.search(query, 1000).totalHits;
+    long numHits = searcher.search(query, 1000).totalHits.value;
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,C,D => A, B & <empty string> are in range", 3, numHits);
     // until Lucene-38 is fixed, use this assert:
@@ -281,7 +281,7 @@ public class TestTermRangeQuery extends LuceneTestCase {
     initializeIndex(new String[] {"A", "B", "", "D"}, analyzer);
     reader = DirectoryReader.open(dir);
     searcher = newSearcher(reader);
-    numHits = searcher.search(query, 1000).totalHits;
+    numHits = searcher.search(query, 1000).totalHits.value;
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,D => A, B & <empty string> are in range", 3, numHits);
     // until Lucene-38 is fixed, use this assert:
@@ -290,7 +290,7 @@ public class TestTermRangeQuery extends LuceneTestCase {
     addDoc("C");
     reader = DirectoryReader.open(dir);
     searcher = newSearcher(reader);
-    numHits = searcher.search(query, 1000).totalHits;
+    numHits = searcher.search(query, 1000).totalHits.value;
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("C added, still A, B & <empty string> are in range", 3, numHits);
     // until Lucene-38 is fixed, use this assert
@@ -306,7 +306,7 @@ public class TestTermRangeQuery extends LuceneTestCase {
     initializeIndex(new String[]{"A", "B", "","C", "D"}, analyzer);
     IndexReader reader = DirectoryReader.open(dir);
     IndexSearcher searcher = newSearcher(reader);
-    long numHits = searcher.search(query, 1000).totalHits;
+    long numHits = searcher.search(query, 1000).totalHits.value;
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,C,D => A,B,<empty string>,C in range", 4, numHits);
     // until Lucene-38 is fixed, use this assert
@@ -315,7 +315,7 @@ public class TestTermRangeQuery extends LuceneTestCase {
     initializeIndex(new String[]{"A", "B", "", "D"}, analyzer);
     reader = DirectoryReader.open(dir);
     searcher = newSearcher(reader);
-    numHits = searcher.search(query, 1000).totalHits;
+    numHits = searcher.search(query, 1000).totalHits.value;
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("A,B,<empty string>,D - A, B and <empty string> in range", 3, numHits);
     // until Lucene-38 is fixed, use this assert
@@ -324,7 +324,7 @@ public class TestTermRangeQuery extends LuceneTestCase {
     addDoc("C");
     reader = DirectoryReader.open(dir);
     searcher = newSearcher(reader);
-    numHits = searcher.search(query, 1000).totalHits;
+    numHits = searcher.search(query, 1000).totalHits.value;
     // When Lucene-38 is fixed, use the assert on the next line:
     assertEquals("C added => A,B,<empty string>,C in range", 4, numHits);
     // until Lucene-38 is fixed, use this assert

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java
index 4cf36ef..8311465 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsCollector.java
@@ -46,7 +46,7 @@ public class TestTopDocsCollector extends LuceneTestCase {
         return EMPTY_TOPDOCS;
       }
       
-      return new TopDocs(totalHits, results);
+      return new TopDocs(new TotalHits(totalHits, totalHitsRelation), results);
     }
     
     @Override
@@ -288,7 +288,7 @@ public class TestTopDocsCollector extends LuceneTestCase {
     dir.close();
   }
 
-  public void testEstimateHitCount() throws Exception {
+  public void testNotTrackTotalHits() throws Exception {
     Directory dir = newDirectory();
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig().setMergePolicy(NoMergePolicy.INSTANCE));
     Document doc = new Document();
@@ -323,64 +323,8 @@ public class TestTopDocsCollector extends LuceneTestCase {
 
     TopDocs topDocs = collector.topDocs();
     // It assumes all docs matched since numHits was 2 and the first 2 collected docs matched
-    assertEquals(10, topDocs.totalHits);
-
-    // Now test an index that is more sparsely collected
-    collector = TopScoreDocCollector.create(2, null, false);
-
-    leafCollector = collector.getLeafCollector(reader.leaves().get(0));
-    leafCollector.setScorer(scorer);
-
-    scorer.doc = 1;
-    scorer.score = 3;
-    leafCollector.collect(1);
-
-    leafCollector = collector.getLeafCollector(reader.leaves().get(1));
-    leafCollector.setScorer(scorer);
-
-    scorer.doc = 0;
-    scorer.score = 2;
-    leafCollector.collect(0);
-
-    scorer.doc = 2;
-    scorer.score = 5;
-    leafCollector.collect(2);
-
-    topDocs = collector.topDocs();
-    assertEquals(4, topDocs.totalHits);
-
-    // Same 2 first collected docs, but then we collect more docs to make sure
-    // that we use the actual number of collected docs as a lower bound
-    collector = TopScoreDocCollector.create(2, null, false);
-
-    leafCollector = collector.getLeafCollector(reader.leaves().get(0));
-    leafCollector.setScorer(scorer);
-
-    scorer.doc = 1;
-    scorer.score = 3;
-    leafCollector.collect(1);
-
-    leafCollector = collector.getLeafCollector(reader.leaves().get(1));
-    leafCollector.setScorer(scorer);
-
-    scorer.doc = 0;
-    scorer.score = 2;
-    leafCollector.collect(0);
-
-    scorer.doc = 2;
-    scorer.score = 5;
-    leafCollector.collect(2);
-
-    scorer.doc = 3;
-    scorer.score = 4;
-    leafCollector.collect(3);
-
-    scorer.doc = 4;
-    scorer.score = 1;
-    leafCollector.collect(4);
-
-    topDocs = collector.topDocs();
-    assertEquals(5, topDocs.totalHits);
+    assertEquals(3, topDocs.totalHits.value);
+    assertEquals(TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO, topDocs.totalHits.relation);
 
     reader.close();
     dir.close();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java
index 8d6e9d5..36f5275 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTopDocsMerge.java
@@ -77,8 +77,8 @@ public class TestTopDocsMerge extends LuceneTestCase {
 
   public void testInconsistentTopDocsFail() {
     TopDocs[] topDocs = new TopDocs[] {
-        new TopDocs(1, new ScoreDoc[] { new ScoreDoc(1, 1.0f) }),
-        new TopDocs(1, new ScoreDoc[] { new ScoreDoc(1, 1.0f, -1) })
+        new TopDocs(new TotalHits(1, TotalHits.Relation.EQUAL_TO), new ScoreDoc[] { new ScoreDoc(1, 1.0f) }),
+        new TopDocs(new TotalHits(1, TotalHits.Relation.EQUAL_TO), new ScoreDoc[] { new ScoreDoc(1, 1.0f, -1) })
     };
     if (random().nextBoolean()) {
       ArrayUtil.swap(topDocs, 0, 1);
@@ -103,7 +103,7 @@ public class TestTopDocsMerge extends LuceneTestCase {
         // we set the shard index to index in the list here but shuffle the entire list below
         scoreDocs[j] = new ScoreDoc((100 * i) + j, score , i);
       }
-      topDocs.add(new TopDocs(numHits, scoreDocs));
+      topDocs.add(new TopDocs(new TotalHits(numHits, TotalHits.Relation.EQUAL_TO), scoreDocs));
       shardResultMapping.put(i, topDocs.get(i));
     }
     // shuffle the entire thing such that we don't get 1 to 1 mapping of shard index to index in the array
@@ -306,7 +306,7 @@ public class TestTopDocsMerge extends LuceneTestCase {
         if (useFrom) {
           System.out.println("from=" + from + " size=" + size);
         }
-        System.out.println("  top search: " + topHits.totalHits + " totalHits; hits=" + (topHits.scoreDocs == null ? "null" : topHits.scoreDocs.length));
+        System.out.println("  top search: " + topHits.totalHits.value + " totalHits; hits=" + (topHits.scoreDocs == null ? "null" : topHits.scoreDocs.length));
         if (topHits.scoreDocs != null) {
           for(int hitIDX=0;hitIDX<topHits.scoreDocs.length;hitIDX++) {
             final ScoreDoc sd = topHits.scoreDocs[hitIDX];
@@ -337,7 +337,7 @@ public class TestTopDocsMerge extends LuceneTestCase {
 
         shardHits[shardIDX] = subHits;
         if (VERBOSE) {
-          System.out.println("  shard=" + shardIDX + " " + subHits.totalHits + " totalHits hits=" + (subHits.scoreDocs == null ? "null" : subHits.scoreDocs.length));
+          System.out.println("  shard=" + shardIDX + " " + subHits.totalHits.value + " totalHits hits=" + (subHits.scoreDocs == null ? "null" : subHits.scoreDocs.length));
           if (subHits.scoreDocs != null) {
             for(ScoreDoc sd : subHits.scoreDocs) {
               System.out.println("    doc=" + sd.doc + " score=" + sd.score);
@@ -378,4 +378,27 @@ public class TestTopDocsMerge extends LuceneTestCase {
     dir.close();
   }
 
+  public void testMergeTotalHitsRelation() {
+    TopDocs topDocs1 = new TopDocs(new TotalHits(2, TotalHits.Relation.EQUAL_TO), new ScoreDoc[] { new ScoreDoc(42, 2f) });
+    TopDocs topDocs2 = new TopDocs(new TotalHits(1, TotalHits.Relation.EQUAL_TO), new ScoreDoc[] { new ScoreDoc(42, 2f) });
+    TopDocs topDocs3 = new TopDocs(new TotalHits(1, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO), new ScoreDoc[] { new ScoreDoc(42, 2f) });
+    TopDocs topDocs4 = new TopDocs(new TotalHits(3, TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO), new ScoreDoc[] { new ScoreDoc(42, 2f) });
+
+    TopDocs merged1 = TopDocs.merge(1, new TopDocs[] {topDocs1, topDocs2});
+    assertEquals(3, merged1.totalHits.value);
+    assertEquals(TotalHits.Relation.EQUAL_TO, merged1.totalHits.relation);
+
+    TopDocs merged2 = TopDocs.merge(1, new TopDocs[] {topDocs1, topDocs3});
+    assertEquals(3, merged2.totalHits.value);
+    assertEquals(TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO, merged2.totalHits.relation);
+
+    TopDocs merged3 = TopDocs.merge(1, new TopDocs[] {topDocs3, topDocs4});
+    assertEquals(4, merged3.totalHits.value);
+    assertEquals(TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO, merged3.totalHits.relation);
+
+    TopDocs merged4 = TopDocs.merge(1, new TopDocs[] {topDocs4, topDocs2});
+    assertEquals(4, merged4.totalHits.value);
+    assertEquals(TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO, merged4.totalHits.relation);
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java
index 717d843..edcb2d6 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java
@@ -134,7 +134,7 @@ public class TestTopFieldCollector extends LuceneTestCase {
     for(int i = 0; i < sort.length; i++) {
       TopDocsCollector<Entry> tdc = TopFieldCollector.create(sort[i], 10, true);
       TopDocs td = tdc.topDocs();
-      assertEquals(0, td.totalHits);
+      assertEquals(0, td.totalHits.value);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java
index 18eec9e..c82f268 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollectorEarlyTermination.java
@@ -156,10 +156,10 @@ public class TestTopFieldCollectorEarlyTermination extends LuceneTestCase {
           assertTrue(collector2.isEarlyTerminated());
         }
         if (collector2.isEarlyTerminated()) {
-          assertTrue(td2.totalHits >= td1.scoreDocs.length);
-          assertTrue(td2.totalHits <= reader.maxDoc());
+          assertTrue(td2.totalHits.value >= td1.scoreDocs.length);
+          assertTrue(td2.totalHits.value <= reader.maxDoc());
         } else {
-          assertEquals(td2.totalHits, td1.totalHits);
+          assertEquals(td2.totalHits.value, td1.totalHits.value);
         }
         assertTopDocsEquals(td1.scoreDocs, td2.scoreDocs);
       }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java b/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java
index ce476ca..dfbaa55 100644
--- a/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java
+++ b/lucene/core/src/test/org/apache/lucene/search/TestWildcardRandom.java
@@ -94,7 +94,7 @@ public class TestWildcardRandom extends LuceneTestCase {
     }
     Query wq = new WildcardQuery(new Term("field", filledPattern));
     TopDocs docs = searcher.search(wq, 25);
-    assertEquals("Incorrect hits for pattern: " + pattern, numHits, docs.totalHits);
+    assertEquals("Incorrect hits for pattern: " + pattern, numHits, docs.totalHits.value);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
index d9fa0a3..6a7657d 100644
--- a/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
+++ b/lucene/core/src/test/org/apache/lucene/search/similarities/TestBooleanSimilarity.java
@@ -57,16 +57,16 @@ public class TestBooleanSimilarity extends BaseSimilarityTestCase {
     IndexSearcher searcher = newSearcher(reader);
     searcher.setSimilarity(new BooleanSimilarity());
     TopDocs topDocs = searcher.search(new TermQuery(new Term("foo", "bar")), 2);
-    assertEquals(2, topDocs.totalHits);
+    assertEquals(2, topDocs.totalHits.value);
     assertEquals(1f, topDocs.scoreDocs[0].score, 0f);
     assertEquals(1f, topDocs.scoreDocs[1].score, 0f);
 
     topDocs = searcher.search(new TermQuery(new Term("foo", "baz")), 1);
-    assertEquals(1, topDocs.totalHits);
+    assertEquals(1, topDocs.totalHits.value);
     assertEquals(1f, topDocs.scoreDocs[0].score, 0f);
 
     topDocs = searcher.search(new BoostQuery(new TermQuery(new Term("foo", "baz")), 3f), 1);
-    assertEquals(1, topDocs.totalHits);
+    assertEquals(1, topDocs.totalHits.value);
     assertEquals(3f, topDocs.scoreDocs[0].score, 0f);
 
     reader.close();
@@ -89,11 +89,11 @@ public class TestBooleanSimilarity extends BaseSimilarityTestCase {
     PhraseQuery query = new PhraseQuery(2, "foo", "bar", "quux");
 
     TopDocs topDocs = searcher.search(query, 2);
-    assertEquals(1, topDocs.totalHits);
+    assertEquals(1, topDocs.totalHits.value);
     assertEquals(1f, topDocs.scoreDocs[0].score, 0f);
 
     topDocs = searcher.search(new BoostQuery(query, 7), 2);
-    assertEquals(1, topDocs.totalHits);
+    assertEquals(1, topDocs.totalHits.value);
     assertEquals(7f, topDocs.scoreDocs[0].score, 0f);
 
     reader.close();


Mime
View raw message