You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2016/11/10 11:34:00 UTC

[49/58] [abbrv] lucenenet git commit: Grouping: Removed commented code.

Grouping: Removed commented code.


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

Branch: refs/heads/grouping
Commit: dd24cf3a0e30c963393939a1b5ba45e009c709d0
Parents: 41b9732
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sun Nov 6 23:15:52 2016 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Nov 8 02:48:01 2016 +0700

----------------------------------------------------------------------
 .../AbstractAllGroupHeadsCollector.cs           | 29 +-----------
 .../AbstractAllGroupsCollector.cs               | 28 -----------
 .../AbstractFirstPassGroupingCollector.cs       | 20 --------
 .../AbstractGroupFacetCollector.cs              | 25 ----------
 .../AbstractSecondPassGroupingCollector.cs      |  4 +-
 src/Lucene.Net.Grouping/CollectedSearchGroup.cs |  2 +-
 .../Function/FunctionAllGroupHeadsCollector.cs  |  5 +-
 .../Term/TermAllGroupHeadsCollector.cs          |  5 +-
 .../AllGroupHeadsCollectorTest.cs               | 50 --------------------
 .../AllGroupsCollectorTest.cs                   |  1 -
 .../GroupFacetCollectorTest.cs                  | 49 ++-----------------
 src/Lucene.Net.Tests.Grouping/TestGrouping.cs   | 48 -------------------
 12 files changed, 13 insertions(+), 253 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs b/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
index 5668b19..4d3b66f 100644
--- a/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
@@ -151,8 +151,8 @@ namespace Lucene.Net.Search.Grouping
     /// </summary>
     /// <remarks>
     /// LUCENENET: moved this class from of the <see cref="AbstractAllGroupHeadsCollector{TGroupValue}"/>,
-    /// to <see cref="AbstractAllGroupHeadsCollector"/>, made it non-generic so the generic closing type doesn't need 
-    /// to be specified in classes that use <see cref="AbstractAllGroupHeadsCollector_GroupHead"/> as a generic closing type, and renamed 
+    /// made it non-generic so the generic closing type doesn't need to be specified in classes that
+    /// use <see cref="AbstractAllGroupHeadsCollector_GroupHead"/> as a generic closing type, and renamed 
     /// it from GroupHead to <see cref="AbstractAllGroupHeadsCollector_GroupHead"/> to avoid naming conflicts with nested classes 
     /// named GroupHead in derived classes of <see cref="AbstractAllGroupHeadsCollector"/>.
     /// </remarks>
@@ -226,29 +226,4 @@ namespace Lucene.Net.Search.Grouping
         /// <exception cref="IOException">If I/O related errors occur</exception>
         protected abstract void RetrieveGroupHeadAndAddIfNotExist(int doc);
     }
-
-    ///// <summary>
-    ///// LUCENENET specific interface used to apply covariance to GH
-    ///// </summary>
-    //public interface IAbstractAllGroupHeadsCollector<out GH>
-    //{
-    //    /// <summary>
-    //    /// 
-    //    /// </summary>
-    //    /// <param name="maxDoc">The maxDoc of the top level <see cref="Index.IndexReader"/></param>
-    //    /// <returns>a <see cref="FixedBitSet"/> containing all group heads.</returns>
-    //    FixedBitSet RetrieveGroupHeads(int maxDoc);
-
-    //    /// <summary>
-    //    /// 
-    //    /// </summary>
-    //    /// <returns>an int array containing all group heads. The size of the array is equal to number of collected unique groups.</returns>
-    //    int[] RetrieveGroupHeads();
-
-    //    /// <summary>
-    //    /// 
-    //    /// </summary>
-    //    /// <returns>the number of group heads found for a query.</returns>
-    //    int GroupHeadsSize { get; }
-    //}
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/AbstractAllGroupsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/AbstractAllGroupsCollector.cs b/src/Lucene.Net.Grouping/AbstractAllGroupsCollector.cs
index df240ee..6f1edb4 100644
--- a/src/Lucene.Net.Grouping/AbstractAllGroupsCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractAllGroupsCollector.cs
@@ -79,32 +79,4 @@ namespace Lucene.Net.Search.Grouping
         /// <returns>the group values</returns>
         IEnumerable<TGroupValue> Groups { get; }
     }
-
-    ///// <summary>
-    ///// LUCENENET specific class used to reference <see cref="AbstractAllGroupsCollector{TGroupValue}"/>
-    ///// without refering to its generic closing type.
-    ///// </summary>
-    //public abstract class AbstractAllGroupsCollector : Collector
-    //{
-    //    /// <summary>
-    //    /// Returns the total number of groups for the executed search.
-    //    /// This is a convenience method. The following code snippet has the same effect: <code>GetGroups().Count</code>
-    //    /// </summary>
-    //    /// <returns>The total number of groups for the executed search</returns>
-    //    public abstract int GroupCount { get; }
-
-
-    //    // Empty not necessary
-    //    public override Scorer Scorer
-    //    {
-    //        set
-    //        {
-    //        }
-    //    }
-
-    //    public override bool AcceptsDocsOutOfOrder()
-    //    {
-    //        return true;
-    //    }
-    //}
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs b/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs
index c7f6e52..aae0591 100644
--- a/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractFirstPassGroupingCollector.cs
@@ -357,26 +357,6 @@ namespace Lucene.Net.Search.Grouping
         private void BuildSortedSet()
         {
             var comparator = new BuildSortedSetComparer(this);
-            //        var comparator = new Comparator<CollectedSearchGroup<?>>() {
-            //      @Override
-            //      public int compare(CollectedSearchGroup<?> o1, CollectedSearchGroup<?> o2)
-            //{
-            //    for (int compIDX = 0; ; compIDX++)
-            //    {
-            //        FieldComparator <?> fc = comparators[compIDX];
-            //        final int c = reversed[compIDX] * fc.compare(o1.comparatorSlot, o2.comparatorSlot);
-            //        if (c != 0)
-            //        {
-            //            return c;
-            //        }
-            //        else if (compIDX == compIDXEnd)
-            //        {
-            //            return o1.topDoc - o2.topDoc;
-            //        }
-            //    }
-            //}
-            //    };
-
             orderedGroups = new SortedSet<CollectedSearchGroup<TGroupValue>>(comparator);
             orderedGroups.UnionWith(groupMap.Values);
             Debug.Assert(orderedGroups.Count > 0);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/AbstractGroupFacetCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/AbstractGroupFacetCollector.cs b/src/Lucene.Net.Grouping/AbstractGroupFacetCollector.cs
index 9769871..920e6d3 100644
--- a/src/Lucene.Net.Grouping/AbstractGroupFacetCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractGroupFacetCollector.cs
@@ -137,33 +137,8 @@ namespace Lucene.Net.Search.Grouping
         public class GroupedFacetResult
         {
             private readonly static IComparer<FacetEntry> orderByCountAndValue = new OrderByCountAndValueComparer();
-            //    private readonly static IComparer<FacetEntry> orderByCountAndValue = new Comparator<FacetEntry>() {
-
-            //      @Override
-            //      public override int Compare(FacetEntry a, FacetEntry b)
-            //    {
-            //        int cmp = b.count - a.count; // Highest count first!
-            //        if (cmp != 0)
-            //        {
-            //            return cmp;
-            //        }
-            //        return a.value.compareTo(b.value);
-            //    }
-
-            //};
-
             private readonly static IComparer<FacetEntry> orderByValue = new OrderByValueComparer();
 
-            //            private readonly static IComparer<FacetEntry> orderByValue = new Comparator<FacetEntry>() {
-
-            //      @Override
-            //      public int compare(FacetEntry a, FacetEntry b)
-            //{
-            //    return a.value.compareTo(b.value);
-            //}
-
-            //    };
-
             private readonly int maxSize;
             private readonly TreeSet<FacetEntry> facetEntries;
             private readonly int totalMissingCount;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
index 6364d90..de3feb6 100644
--- a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
@@ -50,7 +50,6 @@ namespace Lucene.Net.Search.Grouping
             foreach (SearchGroup<TGroupValue> group in groups)
             {
                 //System.out.println("  prep group=" + (group.groupValue == null ? "null" : group.groupValue.utf8ToString()));
-                //TopDocsCollector collector;
                 ITopDocsCollector collector;
                 if (withinGroupSort == null)
                 {
@@ -156,9 +155,8 @@ namespace Lucene.Net.Search.Grouping
         public class SearchGroupDocs<TGroupValue>
         {
             public readonly TGroupValue groupValue;
-            //public readonly TopDocsCollector<?> collector;
             public readonly ITopDocsCollector collector;
-            public SearchGroupDocs(TGroupValue groupValue, ITopDocsCollector /*TopDocsCollector<?>*/ collector)
+            public SearchGroupDocs(TGroupValue groupValue, ITopDocsCollector collector)
             {
                 this.groupValue = groupValue;
                 this.collector = collector;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/CollectedSearchGroup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/CollectedSearchGroup.cs b/src/Lucene.Net.Grouping/CollectedSearchGroup.cs
index 9ed6cb8..50b5bd7 100644
--- a/src/Lucene.Net.Grouping/CollectedSearchGroup.cs
+++ b/src/Lucene.Net.Grouping/CollectedSearchGroup.cs
@@ -21,7 +21,7 @@ namespace Lucene.Net.Search.Grouping
 
     /// <summary>
     /// LUCENENET specific interface for passing/comparing the CollectedSearchGroup
-    /// without referencing its generic type
+    /// without referencing its generic closing type
     /// </summary>
     public interface ICollectedSearchGroup
     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/Function/FunctionAllGroupHeadsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/Function/FunctionAllGroupHeadsCollector.cs b/src/Lucene.Net.Grouping/Function/FunctionAllGroupHeadsCollector.cs
index 9b7f0cd..f0410d2 100644
--- a/src/Lucene.Net.Grouping/Function/FunctionAllGroupHeadsCollector.cs
+++ b/src/Lucene.Net.Grouping/Function/FunctionAllGroupHeadsCollector.cs
@@ -111,15 +111,16 @@ namespace Lucene.Net.Search.Grouping.Function
         /** Holds current head document for a single group.
          *
          * @lucene.experimental */
-        public class GroupHead : AbstractAllGroupHeadsCollector_GroupHead /*AbstractAllGroupHeadsCollector.GroupHead<MutableValue>*/
+        public class GroupHead : AbstractAllGroupHeadsCollector_GroupHead
         {
 
             private readonly FunctionAllGroupHeadsCollector outerInstance;
+            // LUCENENET: Moved this here from the base class, AbstractAllGroupHeadsCollector_GroupHead so it doesn't
+            // need to reference the generic closing type MutableValue.
             public readonly MutableValue groupValue;
             internal readonly FieldComparator[] comparators;
 
             internal GroupHead(FunctionAllGroupHeadsCollector outerInstance, MutableValue groupValue, Sort sort, int doc)
-                        /*: base(groupValue, doc + outerInstance.readerContext.DocBase)*/
                         : base(doc + outerInstance.readerContext.DocBase)
             {
                 this.outerInstance = outerInstance;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Grouping/Term/TermAllGroupHeadsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/Term/TermAllGroupHeadsCollector.cs b/src/Lucene.Net.Grouping/Term/TermAllGroupHeadsCollector.cs
index 054dacc..4aa9615 100644
--- a/src/Lucene.Net.Grouping/Term/TermAllGroupHeadsCollector.cs
+++ b/src/Lucene.Net.Grouping/Term/TermAllGroupHeadsCollector.cs
@@ -757,9 +757,11 @@ namespace Lucene.Net.Search.Grouping.Terms
             }
         }
 
-        internal class GroupHead : AbstractAllGroupHeadsCollector_GroupHead /*AbstractAllGroupHeadsCollector.GroupHead<BytesRef>*/
+        internal class GroupHead : AbstractAllGroupHeadsCollector_GroupHead
         {
             private readonly ScoreAllGroupHeadsCollector outerInstance;
+            // LUCENENET: Moved this here from the base class, AbstractAllGroupHeadsCollector_GroupHead so it doesn't
+            // need to reference the generic closing type BytesRef.
             public readonly BytesRef groupValue;
             internal float[] scores;
 
@@ -800,7 +802,6 @@ namespace Lucene.Net.Search.Grouping.Terms
                 }
                 this.Doc = doc + outerInstance.readerContext.DocBase;
             }
-
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs b/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs
index 6b7c06a..2d8e8fe 100644
--- a/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs
+++ b/src/Lucene.Net.Tests.Grouping/AllGroupHeadsCollectorTest.cs
@@ -488,7 +488,6 @@ namespace Lucene.Net.Search.Grouping
             {
                 List<GroupDoc> docs = groupHeads[groupValue];
                 docs.Sort(GetComparator(docSort, sortByScoreOnly, fieldIdToDocID));
-                //Collections.Sort(docs, getComparator(docSort, sortByScoreOnly, fieldIdToDocID));
                 allGroupHeads[i++] = docs[0].id;
             }
 
@@ -600,55 +599,6 @@ namespace Lucene.Net.Search.Grouping
         {
             SortField[] sortFields = sort.GetSort();
             return new ComparatorAnonymousHelper(this, sortFields, sortByScoreOnly, fieldIdToDocID);
-            //    return new Comparator<GroupDoc>() {
-            //      @Override
-            //      public int compare(GroupDoc d1, GroupDoc d2)
-            //{
-            //    for (SortField sf : sortFields)
-            //    {
-            //        final int cmp;
-            //        if (sf.getType() == SortField.Type.SCORE)
-            //        {
-            //            if (d1.score > d2.score)
-            //            {
-            //                cmp = -1;
-            //            }
-            //            else if (d1.score < d2.score)
-            //            {
-            //                cmp = 1;
-            //            }
-            //            else
-            //            {
-            //                cmp = sortByScoreOnly ? fieldIdToDocID[d1.id] - fieldIdToDocID[d2.id] : 0;
-            //            }
-            //        }
-            //        else if (sf.getField().equals("sort1"))
-            //        {
-            //            cmp = d1.sort1.compareTo(d2.sort1);
-            //        }
-            //        else if (sf.getField().equals("sort2"))
-            //        {
-            //            cmp = d1.sort2.compareTo(d2.sort2);
-            //        }
-            //        else if (sf.getField().equals("sort3"))
-            //        {
-            //            cmp = d1.sort3.compareTo(d2.sort3);
-            //        }
-            //        else
-            //        {
-            //            assertEquals(sf.getField(), "id");
-            //            cmp = d1.id - d2.id;
-            //        }
-            //        if (cmp != 0)
-            //        {
-            //            return sf.getReverse() ? -cmp : cmp;
-            //        }
-            //    }
-            //    // Our sort always fully tie breaks:
-            //    fail();
-            //    return 0;
-            //}
-            //    };
         }
 
         private AbstractAllGroupHeadsCollector CreateRandomCollector(string groupField, Sort sortWithinGroup, bool canUseIDV, DocValuesType_e valueType)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Tests.Grouping/AllGroupsCollectorTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/AllGroupsCollectorTest.cs b/src/Lucene.Net.Tests.Grouping/AllGroupsCollectorTest.cs
index 681c644..1efd4b5 100644
--- a/src/Lucene.Net.Tests.Grouping/AllGroupsCollectorTest.cs
+++ b/src/Lucene.Net.Tests.Grouping/AllGroupsCollectorTest.cs
@@ -139,6 +139,5 @@ namespace Lucene.Net.Search.Grouping
 
             return selected;
         }
-
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs b/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs
index a8f191d..dda2cdb 100644
--- a/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs
+++ b/src/Lucene.Net.Tests.Grouping/GroupFacetCollectorTest.cs
@@ -586,31 +586,10 @@ namespace Lucene.Net.Search.Grouping
             docNoFacet.Add(content);
             docNoGroupNoFacet.Add(content);
 
+            // LUCENENET NOTE: TreeSet (the class used in Java) allows duplicate keys. However, SortedSet seems to work,
+            // and based on the name of the variable, presuming the keys are meant to be unique.
             ISet<string> uniqueFacetValues = new SortedSet<string>(new ComparerAnonymousHelper1());
-            //    ISet<string> uniqueFacetValues = new SortedSet<string>(new Comparator<String>() {
-
-            //      @Override
-            //      public int compare(String a, String b)
-            //{
-            //    if (a == b)
-            //    {
-            //        return 0;
-            //    }
-            //    else if (a == null)
-            //    {
-            //        return -1;
-            //    }
-            //    else if (b == null)
-            //    {
-            //        return 1;
-            //    }
-            //    else
-            //    {
-            //        return a.compareTo(b);
-            //    }
-            //}
-
-            //    });
+
             // LUCENENET NOTE: Need HashMap here because of null keys
             IDictionary<string, HashMap<string, ISet<string>>> searchTermToFacetToGroups = new Dictionary<string, HashMap<string, ISet<string>>>();
             int facetWithMostGroups = 0;
@@ -767,8 +746,6 @@ namespace Lucene.Net.Search.Grouping
 
         private GroupedFacetResult CreateExpectedFacetResult(string searchTerm, IndexContext context, int offset, int limit, int minCount, bool orderByCount, string facetPrefix)
         {
-            //IDictionary<string, ISet<string>> facetGroups = context.searchTermToFacetGroups.get(searchTerm);
-            //if (facetGroups == null)
             HashMap<string, ISet<string>> facetGroups;
             if (!context.searchTermToFacetGroups.TryGetValue(searchTerm, out facetGroups))
             {
@@ -824,24 +801,6 @@ namespace Lucene.Net.Search.Grouping
 
             entries.Sort(new ComparerAnonymousHelper2(orderByCount));
 
-            //    Collections.sort(entries, new Comparator<TermGroupFacetCollector.FacetEntry>() {
-
-            //      @Override
-            //      public int compare(TermGroupFacetCollector.FacetEntry a, TermGroupFacetCollector.FacetEntry b)
-            //{
-            //    if (orderByCount)
-            //    {
-            //        int cmp = b.getCount() - a.getCount();
-            //        if (cmp != 0)
-            //        {
-            //            return cmp;
-            //        }
-            //    }
-            //    return a.getValue().compareTo(b.getValue());
-            //}
-
-            //    });
-
             int endOffset = offset + limit;
             List<TermGroupFacetCollector.FacetEntry> entriesResult;
             if (offset >= entries.size())
@@ -850,12 +809,10 @@ namespace Lucene.Net.Search.Grouping
             }
             else if (endOffset >= entries.size())
             {
-                //entriesResult = (List<TermGroupFacetCollector.FacetEntry>)entries.SubList(offset, entries.size());
                 entriesResult = entries.GetRange(offset, entries.size() - offset);
             }
             else
             {
-                //entriesResult = (List<TermGroupFacetCollector.FacetEntry>)entries.SubList(offset, endOffset);
                 entriesResult = entries.GetRange(offset, endOffset - offset);
             }
             return new GroupedFacetResult(totalCount, totalMissCount, entriesResult);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/dd24cf3a/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/TestGrouping.cs b/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
index 2291a74..ddef166 100644
--- a/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
+++ b/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
@@ -480,51 +480,6 @@ namespace Lucene.Net.Search.Grouping
         {
             SortField[] sortFields = sort.GetSort();
             return new ComparerAnonymousHelper(this, sortFields);
-            //    return new Comparator<GroupDoc>() {
-            //      @Override
-            //      public int compare(GroupDoc d1, GroupDoc d2)
-            //{
-            //    for (SortField sf : sortFields)
-            //    {
-            //        final int cmp;
-            //        if (sf.getType() == SortField.Type.SCORE)
-            //        {
-            //            if (d1.score > d2.score)
-            //            {
-            //                cmp = -1;
-            //            }
-            //            else if (d1.score < d2.score)
-            //            {
-            //                cmp = 1;
-            //            }
-            //            else
-            //            {
-            //                cmp = 0;
-            //            }
-            //        }
-            //        else if (sf.getField().equals("sort1"))
-            //        {
-            //            cmp = d1.sort1.compareTo(d2.sort1);
-            //        }
-            //        else if (sf.getField().equals("sort2"))
-            //        {
-            //            cmp = d1.sort2.compareTo(d2.sort2);
-            //        }
-            //        else
-            //        {
-            //            assertEquals(sf.getField(), "id");
-            //            cmp = d1.id - d2.id;
-            //        }
-            //        if (cmp != 0)
-            //        {
-            //            return sf.getReverse() ? -cmp : cmp;
-            //        }
-            //    }
-            //    // Our sort always fully tie breaks:
-            //    fail();
-            //    return 0;
-            //}
-            //    };
         }
 
         private IComparable[] FillFields(GroupDoc d, Sort sort)
@@ -645,7 +600,6 @@ namespace Lucene.Net.Search.Grouping
                 BytesRef group = sortedGroups[idx];
                 List<GroupDoc> docs = groups[group];
                 totalGroupedHitCount += docs.size();
-                //Collections.sort(docs, docSortComp);
                 docs.Sort(docSortComp);
                 ScoreDoc[] hits;
                 if (docs.size() > docOffset)
@@ -696,7 +650,6 @@ namespace Lucene.Net.Search.Grouping
         private DirectoryReader GetDocBlockReader(Directory dir, GroupDoc[] groupDocs)
         {
             // Coalesce by group, but in random order:
-            //Collections.shuffle(Arrays.asList(groupDocs), Random());
             groupDocs = CollectionsHelper.Shuffle(Arrays.AsList(groupDocs)).ToArray();
             HashMap<BytesRef, List<GroupDoc>> groupMap = new HashMap<BytesRef, List<GroupDoc>>();
             List<BytesRef> groupValues = new List<BytesRef>();
@@ -1710,7 +1663,6 @@ namespace Lucene.Net.Search.Grouping
             public ShardSearcher(AtomicReaderContext ctx, IndexReaderContext parent)
                             : base(parent)
             {
-                //this.ctx = Collections.SingletonList(ctx);
                 this.ctx = new List<AtomicReaderContext>(new AtomicReaderContext[] { ctx });
             }