lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [11/12] lucenenet git commit: Lucene.Net.Join.ToParentBlockJoinCollector refactor: Changed return type of GetTopGroups(), AccumulateGroups() and GetTopGroupsWithAllChildDocs() from TopGroups<T> to ITopGroups<T>
Date Thu, 26 Jan 2017 14:38:09 GMT
Lucene.Net.Join.ToParentBlockJoinCollector refactor: Changed return type of GetTopGroups(),
AccumulateGroups() and GetTopGroupsWithAllChildDocs() from TopGroups<T> to ITopGroups<T>


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/f8681b27
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/f8681b27
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/f8681b27

Branch: refs/heads/api-work
Commit: f8681b2719be7e39c5e859d3f54bfc8f20c3133b
Parents: 057b654
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Thu Jan 26 21:32:32 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Jan 26 21:32:32 2017 +0700

----------------------------------------------------------------------
 .../ToParentBlockJoinCollector.cs               |  6 +++---
 src/Lucene.Net.Tests.Join/TestBlockJoin.cs      | 22 ++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f8681b27/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs b/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs
index b9e1fe1..d537a55 100644
--- a/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs
+++ b/src/Lucene.Net.Join/ToParentBlockJoinCollector.cs
@@ -397,7 +397,7 @@ namespace Lucene.Net.Join
         /// <param name="fillSortFields"> Specifies whether to add sort fields or not
</param>
         /// <returns> TopGroups for specified query </returns>
         /// <exception cref="IOException"> if there is a low-level I/O error </exception>
-        public virtual TopGroups<int> GetTopGroups(ToParentBlockJoinQuery query, Sort
withinGroupSort, int offset, int maxDocsPerGroup, int withinGroupOffset, bool fillSortFields)
+        public virtual ITopGroups<int> GetTopGroups(ToParentBlockJoinQuery query, Sort
withinGroupSort, int offset, int maxDocsPerGroup, int withinGroupOffset, bool fillSortFields)
         {
             int? slot;
             if (!joinQueryID.TryGetValue(query, out slot))
@@ -435,7 +435,7 @@ namespace Lucene.Net.Join
         /// <param name="fillSortFields"> Specifies whether to add sort fields or not
</param>
         /// <returns> TopGroups for the query specified by slot </returns>
         /// <exception cref="IOException"> if there is a low-level I/O error </exception>
-        private TopGroups<int> AccumulateGroups(int slot, int offset, int maxDocsPerGroup,
int withinGroupOffset, Sort withinGroupSort, bool fillSortFields)
+        private ITopGroups<int> AccumulateGroups(int slot, int offset, int maxDocsPerGroup,
int withinGroupOffset, Sort withinGroupSort, bool fillSortFields)
         {
             var groups = new GroupDocs<int>[sortedGroups.Length - offset];
             var fakeScorer = new FakeScorer();
@@ -539,7 +539,7 @@ namespace Lucene.Net.Join
         /// <param name="fillSortFields">Specifies whether to add sort fields or not</param>
         /// <returns>TopGroups for specified query</returns>
         /// <exception cref="IOException"> if there is a low-level I/O error </exception>
-        public virtual TopGroups<int> GetTopGroupsWithAllChildDocs(ToParentBlockJoinQuery
query, Sort withinGroupSort, int offset, int withinGroupOffset, bool fillSortFields)
+        public virtual ITopGroups<int> GetTopGroupsWithAllChildDocs(ToParentBlockJoinQuery
query, Sort withinGroupSort, int offset, int withinGroupOffset, bool fillSortFields)
         {
             return GetTopGroups(query, withinGroupSort, offset, int.MaxValue, withinGroupOffset,
fillSortFields);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f8681b27/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
index 8698407..60c04ea 100644
--- a/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
+++ b/src/Lucene.Net.Tests.Join/TestBlockJoin.cs
@@ -112,7 +112,7 @@ namespace Lucene.Net.Tests.Join
             fullQuery.Add(new BooleanClause(new MatchAllDocsQuery(), Occur.MUST));
             ToParentBlockJoinCollector c = new ToParentBlockJoinCollector(Sort.RELEVANCE,
1, true, true);
             s.Search(fullQuery, c);
-            TopGroups<int> results = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
true);
+            ITopGroups<int> results = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
true);
             assertFalse(float.IsNaN(results.MaxScore));
             assertEquals(1, results.TotalGroupedHitCount);
             assertEquals(1, results.Groups.Length);
@@ -174,7 +174,7 @@ namespace Lucene.Net.Tests.Join
 
             s.Search(fullQuery, c);
 
-            TopGroups<int> results = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
true);
+            ITopGroups<int> results = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
true);
             assertFalse(float.IsNaN(results.MaxScore));
 
             //assertEquals(1, results.totalHitCount);
@@ -259,7 +259,7 @@ namespace Lucene.Net.Tests.Join
             ToParentBlockJoinCollector c = new ToParentBlockJoinCollector(Sort.RELEVANCE,
10, true, true);
 
             s.Search(qp, c);
-            TopGroups<int> groups = c.GetTopGroups(qp, Sort.INDEXORDER, 0, 10, 0, true);
+            ITopGroups<int> groups = c.GetTopGroups(qp, Sort.INDEXORDER, 0, 10, 0,
true);
             foreach (GroupDocs<int> group in groups.Groups)
             {
                 assertEquals(1, group.TotalHits);
@@ -828,7 +828,7 @@ namespace Lucene.Net.Tests.Join
 
                 int hitsPerGroup = TestUtil.NextInt(Random(), 1, 20);
                 //final int hitsPerGroup = 100;
-                TopGroups<int> joinResults = c.GetTopGroups(childJoinQuery, childSort,
0, hitsPerGroup, 0, true);
+                ITopGroups<int> joinResults = c.GetTopGroups(childJoinQuery, childSort,
0, hitsPerGroup, 0, true);
 
                 if (VERBOSE)
                 {
@@ -1077,7 +1077,7 @@ namespace Lucene.Net.Tests.Join
             }
         }
         
-        private void CompareHits(IndexReader r, IndexReader joinR, TopDocs results, TopGroups<int>
joinResults)
+        private void CompareHits(IndexReader r, IndexReader joinR, TopDocs results, ITopGroups<int>
joinResults)
         {
             // results is 'complete'; joinResults is a subset
             int resultUpto = 0;
@@ -1173,7 +1173,7 @@ namespace Lucene.Net.Tests.Join
             s.Search(fullQuery, c);
 
             // Examine "Job" children
-            TopGroups<int> jobResults = c.GetTopGroups(childJobJoinQuery, null, 0,
10, 0, true);
+            ITopGroups<int> jobResults = c.GetTopGroups(childJobJoinQuery, null, 0,
10, 0, true);
 
             //assertEquals(1, results.totalHitCount);
             assertEquals(1, jobResults.TotalGroupedHitCount);
@@ -1190,7 +1190,7 @@ namespace Lucene.Net.Tests.Join
             assertEquals("Lisa", parentDoc.Get("name"));
 
             // Now Examine qualification children
-            TopGroups<int> qualificationResults = c.GetTopGroups(childQualificationJoinQuery,
null, 0, 10, 0, true);
+            ITopGroups<int> qualificationResults = c.GetTopGroups(childQualificationJoinQuery,
null, 0, 10, 0, true);
 
             assertEquals(1, qualificationResults.TotalGroupedHitCount);
             assertEquals(1, qualificationResults.Groups.Length);
@@ -1305,7 +1305,7 @@ namespace Lucene.Net.Tests.Join
             s.Search(childJoinQuery, c);
 
             //Get all child documents within groups
-            TopGroups<int>[] getTopGroupsResults = new TopGroups<int>[2];
+            ITopGroups<int>[] getTopGroupsResults = new ITopGroups<int>[2];
             getTopGroupsResults[0] = c.GetTopGroups(childJoinQuery, null, 0, 10, 0, true);
             getTopGroupsResults[1] = c.GetTopGroupsWithAllChildDocs(childJoinQuery, null,
0, 0, true);
 
@@ -1334,7 +1334,7 @@ namespace Lucene.Net.Tests.Join
             }
 
             //Get part of child documents
-            TopGroups<int> boundedResults = c.GetTopGroups(childJoinQuery, null, 0,
1, 0, true);
+            ITopGroups<int> boundedResults = c.GetTopGroups(childJoinQuery, null, 0,
1, 0, true);
             assertFalse(float.IsNaN(boundedResults.MaxScore));
             assertEquals(2, boundedResults.TotalGroupedHitCount);
             assertEquals(1, boundedResults.Groups.Length);
@@ -1405,7 +1405,7 @@ namespace Lucene.Net.Tests.Join
 
             ToParentBlockJoinCollector c = new ToParentBlockJoinCollector(new Sort(new SortField("parentID",
SortFieldType.STRING)), 10, true, true);
             NewSearcher(r).Search(parentQuery, c);
-            TopGroups<int> groups = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
false);
+            ITopGroups<int> groups = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
false);
 
             // Two parents:
             assertEquals(2, (int)groups.TotalGroupCount);
@@ -1471,7 +1471,7 @@ namespace Lucene.Net.Tests.Join
 
             ToParentBlockJoinCollector c = new ToParentBlockJoinCollector(new Sort(new SortField("parentID",
SortFieldType.STRING)), 10, true, true);
             NewSearcher(r).Search(parentQuery, c);
-            TopGroups<int> groups = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
false);
+            ITopGroups<int> groups = c.GetTopGroups(childJoinQuery, null, 0, 10, 0,
false);
 
             // Two parents:
             assertEquals(2, (int)groups.TotalGroupCount);


Mime
View raw message