lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject [26/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:42 GMT
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
b/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
index 4ca56e9..85eea60 100644
--- a/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
+++ b/solr/core/src/test/org/apache/solr/uninverting/TestFieldCacheSortRandom.java
@@ -174,7 +174,7 @@ public class TestFieldCacheSortRandom extends LuceneTestCase {
       }
 
       if (VERBOSE) {
-        System.out.println("\nTEST: iter=" + iter + " " + hits.totalHits + " hits; topN="
+ hitCount + "; reverse=" + reverse + "; sortMissingLast=" + sortMissingLast + " sort=" +
sort);
+        System.out.println("\nTEST: iter=" + iter + " " + hits.totalHits + " ; topN=" + hitCount
+ "; reverse=" + reverse + "; sortMissingLast=" + sortMissingLast + " sort=" + sort);
       }
 
       // Compute expected results:

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms32.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms32.java b/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms32.java
index b9392b7..cc80867 100644
--- a/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms32.java
+++ b/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms32.java
@@ -127,7 +127,7 @@ public class TestNumericTerms32 extends LuceneTestCase {
       }
       Query tq= LegacyNumericRangeQuery.newIntRange(field, precisionStep, lower, upper, true,
true);
       TopDocs topDocs = searcher.search(tq, noDocs, new Sort(new SortField(field, SortField.Type.INT,
true)));
-      if (topDocs.totalHits==0) continue;
+      if (topDocs.totalHits.value==0) continue;
       ScoreDoc[] sd = topDocs.scoreDocs;
       assertNotNull(sd);
       int last = searcher.doc(sd[0].doc).getField(field).numericValue().intValue();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms64.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms64.java b/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms64.java
index 61a3579..7de523b 100644
--- a/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms64.java
+++ b/solr/core/src/test/org/apache/solr/uninverting/TestNumericTerms64.java
@@ -132,7 +132,7 @@ public class TestNumericTerms64 extends LuceneTestCase {
       }
       Query tq= LegacyNumericRangeQuery.newLongRange(field, precisionStep, lower, upper,
true, true);
       TopDocs topDocs = searcher.search(tq, noDocs, new Sort(new SortField(field, SortField.Type.LONG,
true)));
-      if (topDocs.totalHits==0) continue;
+      if (topDocs.totalHits.value==0) continue;
       ScoreDoc[] sd = topDocs.scoreDocs;
       assertNotNull(sd);
       long last=searcher.doc(sd[0].doc).getField(field).numericValue().longValue();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ca05371/solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java b/solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java
index 1913166..a302d58 100644
--- a/solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java
+++ b/solr/core/src/test/org/apache/solr/update/AddBlockUpdateTest.java
@@ -178,7 +178,7 @@ public class AddBlockUpdateTest extends SolrTestCaseJ4 {
     assertSingleParentOf(searcher, one("ab"), dubbed);
 
     final TopDocs docs = searcher.search(join(one("cd")), 10);
-    assertEquals(2, docs.totalHits);
+    assertEquals(2, docs.totalHits.value);
     final String pAct = searcher.doc(docs.scoreDocs[0].doc).get(parent)+
                         searcher.doc(docs.scoreDocs[1].doc).get(parent);
     assertTrue(pAct.contains(dubbed) && pAct.contains(overwritten) && pAct.length()==2);
@@ -704,7 +704,7 @@ public class AddBlockUpdateTest extends SolrTestCaseJ4 {
   protected void assertSingleParentOf(final SolrIndexSearcher searcher,
       final String childTerm, String parentExp) throws IOException {
     final TopDocs docs = searcher.search(join(childTerm), 10);
-    assertEquals(1, docs.totalHits);
+    assertEquals(1, docs.totalHits.value);
     final String pAct = searcher.doc(docs.scoreDocs[0].doc).get(parent);
     assertEquals(parentExp, pAct);
   }


Mime
View raw message