Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A0060200C17 for ; Thu, 26 Jan 2017 15:38:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9EC5C160B40; Thu, 26 Jan 2017 14:38:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5C0F7160B61 for ; Thu, 26 Jan 2017 15:38:00 +0100 (CET) Received: (qmail 63624 invoked by uid 500); 26 Jan 2017 14:37:59 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 63396 invoked by uid 99); 26 Jan 2017 14:37:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2017 14:37:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4D0F5DFC68; Thu, 26 Jan 2017 14:37:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Date: Thu, 26 Jan 2017 14:38:09 -0000 Message-Id: <54d9c630e83b4286bd16a366768a94b7@git.apache.org> In-Reply-To: <07bf30e34ca3485b82b6eca3c199d5f4@git.apache.org> References: <07bf30e34ca3485b82b6eca3c199d5f4@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/12] lucenenet git commit: Lucene.Net.Join.ToParentBlockJoinCollector refactor: Changed return type of GetTopGroups(), AccumulateGroups() and GetTopGroupsWithAllChildDocs() from TopGroups to ITopGroups archived-at: Thu, 26 Jan 2017 14:38:01 -0000 Lucene.Net.Join.ToParentBlockJoinCollector refactor: Changed return type of GetTopGroups(), AccumulateGroups() and GetTopGroupsWithAllChildDocs() from TopGroups to ITopGroups 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 Authored: Thu Jan 26 21:32:32 2017 +0700 Committer: Shad Storhaug 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 /// Specifies whether to add sort fields or not /// TopGroups for specified query /// if there is a low-level I/O error - public virtual TopGroups GetTopGroups(ToParentBlockJoinQuery query, Sort withinGroupSort, int offset, int maxDocsPerGroup, int withinGroupOffset, bool fillSortFields) + public virtual ITopGroups 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 /// Specifies whether to add sort fields or not /// TopGroups for the query specified by slot /// if there is a low-level I/O error - private TopGroups AccumulateGroups(int slot, int offset, int maxDocsPerGroup, int withinGroupOffset, Sort withinGroupSort, bool fillSortFields) + private ITopGroups AccumulateGroups(int slot, int offset, int maxDocsPerGroup, int withinGroupOffset, Sort withinGroupSort, bool fillSortFields) { var groups = new GroupDocs[sortedGroups.Length - offset]; var fakeScorer = new FakeScorer(); @@ -539,7 +539,7 @@ namespace Lucene.Net.Join /// Specifies whether to add sort fields or not /// TopGroups for specified query /// if there is a low-level I/O error - public virtual TopGroups GetTopGroupsWithAllChildDocs(ToParentBlockJoinQuery query, Sort withinGroupSort, int offset, int withinGroupOffset, bool fillSortFields) + public virtual ITopGroups 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 results = c.GetTopGroups(childJoinQuery, null, 0, 10, 0, true); + ITopGroups 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 results = c.GetTopGroups(childJoinQuery, null, 0, 10, 0, true); + ITopGroups 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 groups = c.GetTopGroups(qp, Sort.INDEXORDER, 0, 10, 0, true); + ITopGroups groups = c.GetTopGroups(qp, Sort.INDEXORDER, 0, 10, 0, true); foreach (GroupDocs 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 joinResults = c.GetTopGroups(childJoinQuery, childSort, 0, hitsPerGroup, 0, true); + ITopGroups 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 joinResults) + private void CompareHits(IndexReader r, IndexReader joinR, TopDocs results, ITopGroups 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 jobResults = c.GetTopGroups(childJobJoinQuery, null, 0, 10, 0, true); + ITopGroups 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 qualificationResults = c.GetTopGroups(childQualificationJoinQuery, null, 0, 10, 0, true); + ITopGroups 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[] getTopGroupsResults = new TopGroups[2]; + ITopGroups[] getTopGroupsResults = new ITopGroups[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 boundedResults = c.GetTopGroups(childJoinQuery, null, 0, 1, 0, true); + ITopGroups 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 groups = c.GetTopGroups(childJoinQuery, null, 0, 10, 0, false); + ITopGroups 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 groups = c.GetTopGroups(childJoinQuery, null, 0, 10, 0, false); + ITopGroups groups = c.GetTopGroups(childJoinQuery, null, 0, 10, 0, false); // Two parents: assertEquals(2, (int)groups.TotalGroupCount);