lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [18/28] lucenenet git commit: Lucene.Net.Grouping refactor: Changed all public fields into properties
Date Wed, 01 Feb 2017 10:22:15 GMT
Lucene.Net.Grouping refactor: Changed all public fields into properties


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

Branch: refs/heads/api-work
Commit: 378f1f126a6006237b8ff0eaabb3d7d704858c8f
Parents: 1dccd77
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Feb 1 16:06:07 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Feb 1 16:06:07 2017 +0700

----------------------------------------------------------------------
 .../AbstractAllGroupHeadsCollector.cs           |  10 +-
 .../AbstractSecondPassGroupingCollector.cs      |  23 ++--
 .../Function/FunctionAllGroupHeadsCollector.cs  |  12 +-
 src/Lucene.Net.Grouping/SearchGroup.cs          | 123 ++++++++++++++-----
 .../Term/TermAllGroupHeadsCollector.cs          |  66 ++++++----
 .../Term/TermSecondPassGroupingCollector.cs     |   4 +-
 6 files changed, 161 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/378f1f12/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs b/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
index f5f5ad0..2fb3d59 100644
--- a/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractAllGroupHeadsCollector.cs
@@ -93,7 +93,7 @@ namespace Lucene.Net.Search.Grouping
         /// Returns the group head and puts it into <see cref="TemporalResult"/>.
         /// If the group head wasn't encountered before then it will be added to the collected
group heads.
         /// <para>
-        /// The <see cref="TemporalResult.stop"/> property will be <c>true</c>
if the group head wasn't encountered before
+        /// The <see cref="TemporalResult.Stop"/> property will be <c>true</c>
if the group head wasn't encountered before
         /// otherwise <c>false</c>.
         /// </para>
         /// </summary>
@@ -111,11 +111,11 @@ namespace Lucene.Net.Search.Grouping
         public override void Collect(int doc)
         {
             RetrieveGroupHeadAndAddIfNotExist(doc);
-            if (m_temporalResult.stop)
+            if (m_temporalResult.Stop)
             {
                 return;
             }
-            GH groupHead = m_temporalResult.groupHead;
+            GH groupHead = m_temporalResult.GroupHead;
 
             // Ok now we need to check if the current doc is more relevant then current doc
for this group
             for (int compIDX = 0; ; compIDX++)
@@ -153,8 +153,8 @@ namespace Lucene.Net.Search.Grouping
         /// </summary>
         protected class TemporalResult
         {
-            public GH groupHead;
-            public bool stop;
+            public GH GroupHead { get; set; }
+            public bool Stop { get; set; }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/378f1f12/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
index deb44a3..ee75c57 100644
--- a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
@@ -86,7 +86,7 @@ namespace Lucene.Net.Search.Grouping
         {
             foreach (AbstractSecondPassGroupingCollector.SearchGroupDocs<TGroupValue>
group in m_groupMap.Values)
             {
-                group.collector.SetScorer(scorer);
+                group.Collector.SetScorer(scorer);
             }
         }
 
@@ -97,7 +97,7 @@ namespace Lucene.Net.Search.Grouping
             if (group != null)
             {
                 totalGroupedHitCount++;
-                group.collector.Collect(doc);
+                group.Collector.Collect(doc);
             }
         }
 
@@ -114,7 +114,7 @@ namespace Lucene.Net.Search.Grouping
             //System.out.println("SP.setNextReader");
             foreach (AbstractSecondPassGroupingCollector.SearchGroupDocs<TGroupValue>
group in m_groupMap.Values)
             {
-                group.collector.SetNextReader(context);
+                group.Collector.SetNextReader(context);
             }
         }
 
@@ -132,12 +132,12 @@ namespace Lucene.Net.Search.Grouping
             foreach (var group in groups)
             {
                 AbstractSecondPassGroupingCollector.SearchGroupDocs<TGroupValue> groupDocs
= m_groupMap.ContainsKey(group.GroupValue) ? m_groupMap[group.GroupValue] : null;
-                TopDocs topDocs = groupDocs.collector.GetTopDocs(withinGroupOffset, maxDocsPerGroup);
+                TopDocs topDocs = groupDocs.Collector.GetTopDocs(withinGroupOffset, maxDocsPerGroup);
                 groupDocsResult[groupIDX++] = new GroupDocs<TGroupValue>(float.NaN,
                                                                               topDocs.MaxScore,
                                                                               topDocs.TotalHits,
                                                                               topDocs.ScoreDocs,
-                                                                              groupDocs.groupValue,
+                                                                              groupDocs.GroupValue,
                                                                               group.SortValues);
                 maxScore = Math.Max(maxScore, topDocs.MaxScore);
             }
@@ -169,8 +169,17 @@ namespace Lucene.Net.Search.Grouping
         // disad: blows up the size of SearchGroup if we need many of them, and couples implementations
         public class SearchGroupDocs<TGroupValue>
         {
-            public readonly TGroupValue groupValue;
-            public readonly ITopDocsCollector collector;
+            public TGroupValue GroupValue
+            {
+                get { return groupValue; }
+            }
+            private readonly TGroupValue groupValue;
+
+            public ITopDocsCollector Collector
+            {
+                get { return collector; }
+            }
+            private readonly ITopDocsCollector collector;
             public SearchGroupDocs(TGroupValue groupValue, ITopDocsCollector collector)
             {
                 this.groupValue = groupValue;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/378f1f12/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 6ca3cdf..98f435e 100644
--- a/src/Lucene.Net.Grouping/Function/FunctionAllGroupHeadsCollector.cs
+++ b/src/Lucene.Net.Grouping/Function/FunctionAllGroupHeadsCollector.cs
@@ -71,13 +71,13 @@ namespace Lucene.Net.Search.Grouping.Function
                 MutableValue groupValue = mval.Duplicate();
                 groupHead = new GroupHead(this, groupValue, sortWithinGroup, doc);
                 groups[groupValue] = groupHead;
-                m_temporalResult.stop = true;
+                m_temporalResult.Stop = true;
             }
             else
             {
-                m_temporalResult.stop = false;
+                m_temporalResult.Stop = false;
             }
-            this.m_temporalResult.groupHead = groupHead;
+            this.m_temporalResult.GroupHead = groupHead;
         }
 
         protected override ICollection<GroupHead> CollectedGroupHeads
@@ -124,7 +124,11 @@ namespace Lucene.Net.Search.Grouping.Function
             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;
+            public MutableValue GroupValue
+            {
+                get { return groupValue; }
+            }
+            private readonly MutableValue groupValue;
             internal readonly FieldComparer[] comparers;
 
             internal GroupHead(FunctionAllGroupHeadsCollector outerInstance, MutableValue
groupValue, Sort sort, int doc)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/378f1f12/src/Lucene.Net.Grouping/SearchGroup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/SearchGroup.cs b/src/Lucene.Net.Grouping/SearchGroup.cs
index cad33f3..a5e6cd5 100644
--- a/src/Lucene.Net.Grouping/SearchGroup.cs
+++ b/src/Lucene.Net.Grouping/SearchGroup.cs
@@ -94,8 +94,17 @@ namespace Lucene.Net.Search.Grouping
 
         private class ShardIter<T>
         {
-            public readonly IEnumerator<ISearchGroup<T>> iter;
-            public readonly int shardIndex;
+            public IEnumerator<ISearchGroup<T>> Iter
+            {
+                get { return iter; }
+            }
+            private readonly IEnumerator<ISearchGroup<T>> iter;
+
+            public int ShardIndex
+            {
+                get { return shardIndex; }
+            }
+            private readonly int shardIndex;
 
             public ShardIter(IEnumerable<ISearchGroup<T>> shard, int shardIndex)
             {
@@ -129,13 +138,47 @@ namespace Lucene.Net.Search.Grouping
         {
 
             // groupValue may be null!
-            public readonly T groupValue;
+            public T GroupValue
+            {
+                get { return groupValue; }
+            }
+            private readonly T groupValue;
 
-            public object[] topValues;
-            public readonly List<ShardIter<T>> shards = new List<ShardIter<T>>();
-            public int minShardIndex;
-            public bool processed;
-            public bool inQueue;
+            [WritableArray]
+            [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's
design requires some writable array properties")]
+            public object[] TopValues
+            {
+                get { return topValues; }
+                set { topValues = value; }
+            }
+            private object[] topValues;
+
+            public IList<ShardIter<T>> Shards
+            {
+                get { return shards; }
+            }
+            private readonly List<ShardIter<T>> shards = new List<ShardIter<T>>();
+
+            public int MinShardIndex
+            {
+                get { return minShardIndex; }
+                set { minShardIndex = value; }
+            }
+            private int minShardIndex;
+
+            public bool IsProcessed
+            {
+                get { return processed; }
+                set { processed = value; }
+            }
+            private bool processed;
+
+            public bool IsInQueue
+            {
+                get { return inQueue; }
+                set { inQueue = value; }
+            }
+            private bool inQueue;
 
             public MergedGroup(T groupValue)
             {
@@ -199,9 +242,21 @@ namespace Lucene.Net.Search.Grouping
 
         private class GroupComparer<T> : IComparer<MergedGroup<T>>
         {
+            [WritableArray]
+            [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's
design requires some writable array properties")]
+            public FieldComparer[] Comparers
+            {
+                get { return comparers; }
+            }
+            private readonly FieldComparer[] comparers;
 
-            public readonly FieldComparer[] comparers;
-            public readonly int[] reversed;
+            [WritableArray]
+            [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's
design requires some writable array properties")]
+            public int[] Reversed
+            {
+                get { return reversed; }
+            }
+            private readonly int[] reversed;
 
             public GroupComparer(Sort groupSort)
             {
@@ -223,8 +278,8 @@ namespace Lucene.Net.Search.Grouping
                     return 0;
                 }
                 //System.out.println("compare group=" + group + " other=" + other);
-                object[] groupValues = group.topValues;
-                object[] otherValues = other.topValues;
+                object[] groupValues = group.TopValues;
+                object[] otherValues = other.TopValues;
                 //System.out.println("  groupValues=" + groupValues + " otherValues=" + otherValues);
                 for (int compIDX = 0; compIDX < comparers.Length; compIDX++)
                 {
@@ -237,8 +292,8 @@ namespace Lucene.Net.Search.Grouping
                 }
 
                 // Tie break by min shard index:
-                Debug.Assert(group.minShardIndex != other.minShardIndex);
-                return group.minShardIndex - other.minShardIndex;
+                Debug.Assert(group.MinShardIndex != other.MinShardIndex);
+                return group.MinShardIndex - other.MinShardIndex;
             }
         }
 
@@ -258,7 +313,7 @@ namespace Lucene.Net.Search.Grouping
 
             private void UpdateNextGroup(int topN, ShardIter<T> shard)
             {
-                while (shard.iter.MoveNext())
+                while (shard.Iter.MoveNext())
                 {
                     ISearchGroup<T> group = shard.Next();
                     MergedGroup<T> mergedGroup = groupsSeen.ContainsKey(group.GroupValue)
? groupsSeen[group.GroupValue] : null;
@@ -270,14 +325,14 @@ namespace Lucene.Net.Search.Grouping
                         // Start a new group:
                         //System.out.println("      new");
                         mergedGroup = new MergedGroup<T>(group.GroupValue);
-                        mergedGroup.minShardIndex = shard.shardIndex;
+                        mergedGroup.MinShardIndex = shard.ShardIndex;
                         Debug.Assert(group.SortValues != null);
-                        mergedGroup.topValues = group.SortValues;
+                        mergedGroup.TopValues = group.SortValues;
                         groupsSeen[group.GroupValue] = mergedGroup;
-                        mergedGroup.inQueue = true;
+                        mergedGroup.IsInQueue = true;
                         queue.Add(mergedGroup);
                     }
-                    else if (mergedGroup.processed)
+                    else if (mergedGroup.IsProcessed)
                     {
                         // This shard produced a group that we already
                         // processed; move on to next group...
@@ -287,10 +342,10 @@ namespace Lucene.Net.Search.Grouping
                     {
                         //System.out.println("      old");
                         bool competes = false;
-                        for (int compIDX = 0; compIDX < groupComp.comparers.Length; compIDX++)
+                        for (int compIDX = 0; compIDX < groupComp.Comparers.Length; compIDX++)
                         {
-                            int cmp = groupComp.reversed[compIDX] * groupComp.comparers[compIDX].CompareValues(group.SortValues[compIDX],
-                                                                                        
                              mergedGroup.topValues[compIDX]);
+                            int cmp = groupComp.Reversed[compIDX] * groupComp.Comparers[compIDX].CompareValues(group.SortValues[compIDX],
+                                                                                        
                              mergedGroup.TopValues[compIDX]);
                             if (cmp < 0)
                             {
                                 // Definitely competes
@@ -302,9 +357,9 @@ namespace Lucene.Net.Search.Grouping
                                 // Definitely does not compete
                                 break;
                             }
-                            else if (compIDX == groupComp.comparers.Length - 1)
+                            else if (compIDX == groupComp.Comparers.Length - 1)
                             {
-                                if (shard.shardIndex < mergedGroup.minShardIndex)
+                                if (shard.ShardIndex < mergedGroup.MinShardIndex)
                                 {
                                     competes = true;
                                 }
@@ -316,18 +371,18 @@ namespace Lucene.Net.Search.Grouping
                         if (competes)
                         {
                             // Group's sort changed -- remove & re-insert
-                            if (mergedGroup.inQueue)
+                            if (mergedGroup.IsInQueue)
                             {
                                 queue.Remove(mergedGroup);
                             }
-                            mergedGroup.topValues = group.SortValues;
-                            mergedGroup.minShardIndex = shard.shardIndex;
+                            mergedGroup.TopValues = group.SortValues;
+                            mergedGroup.MinShardIndex = shard.ShardIndex;
                             queue.Add(mergedGroup);
-                            mergedGroup.inQueue = true;
+                            mergedGroup.IsInQueue = true;
                         }
                     }
 
-                    mergedGroup.shards.Add(shard);
+                    mergedGroup.Shards.Add(shard);
                     break;
                 }
 
@@ -337,7 +392,7 @@ namespace Lucene.Net.Search.Grouping
                     MergedGroup<T> group = queue.Last();
                     queue.Remove(group);
                     //System.out.println("PRUNE: " + group);
-                    group.inQueue = false;
+                    group.IsInQueue = false;
                 }
             }
 
@@ -367,13 +422,13 @@ namespace Lucene.Net.Search.Grouping
                 {
                     MergedGroup<T> group = queue.First();
                     queue.Remove(group);
-                    group.processed = true;
+                    group.IsProcessed = true;
                     //System.out.println("  pop: shards=" + group.shards + " group=" + (group.groupValue
== null ? "null" : (((BytesRef) group.groupValue).utf8ToString())) + " sortValues=" + Arrays.toString(group.topValues));
                     if (count++ >= offset)
                     {
                         SearchGroup<T> newGroup = new SearchGroup<T>();
-                        newGroup.GroupValue = group.groupValue;
-                        newGroup.SortValues = group.topValues;
+                        newGroup.GroupValue = group.GroupValue;
+                        newGroup.SortValues = group.TopValues;
                         newTopGroups.Add(newGroup);
                         if (newTopGroups.Count == topN)
                         {
@@ -384,7 +439,7 @@ namespace Lucene.Net.Search.Grouping
                     }
 
                     // Advance all iters in this group:
-                    foreach (ShardIter<T> shardIter in group.shards)
+                    foreach (ShardIter<T> shardIter in group.Shards)
                     {
                         UpdateNextGroup(maxQueueSize, shardIter);
                     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/378f1f12/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 88ab3ce..8961fed 100644
--- a/src/Lucene.Net.Grouping/Term/TermAllGroupHeadsCollector.cs
+++ b/src/Lucene.Net.Grouping/Term/TermAllGroupHeadsCollector.cs
@@ -176,13 +176,13 @@ namespace Lucene.Net.Search.Grouping.Terms
             {
                 groupHead = new GroupHead(this, groupValue, sortWithinGroup, doc);
                 groups[groupValue == null ? null : BytesRef.DeepCopyOf(groupValue)] = groupHead;
-                m_temporalResult.stop = true;
+                m_temporalResult.Stop = true;
             }
             else
             {
-                m_temporalResult.stop = false;
+                m_temporalResult.Stop = false;
             }
-            m_temporalResult.groupHead = groupHead;
+            m_temporalResult.GroupHead = groupHead;
         }
 
         protected override ICollection<GroupHead> CollectedGroupHeads
@@ -221,7 +221,11 @@ namespace Lucene.Net.Search.Grouping.Terms
             private readonly GeneralAllGroupHeadsCollector outerInstance;
             // LUCENENET: Moved groupValue here from the base class, AbstractAllGroupHeadsCollector_GroupHead
so it doesn't
             // need to reference the generic closing type BytesRef.
-            public readonly BytesRef groupValue;
+            public BytesRef GroupValue
+            {
+                get { return groupValue; }
+            }
+            private readonly BytesRef groupValue;
 
             internal readonly FieldComparer[] comparers;
 
@@ -320,14 +324,14 @@ namespace Lucene.Net.Search.Grouping.Terms
                 groupHead = new GroupHead(this, doc, term);
                 collectedGroups.Add(groupHead);
                 segmentGroupHeads[key + 1] = groupHead;
-                m_temporalResult.stop = true;
+                m_temporalResult.Stop = true;
             }
             else
             {
-                m_temporalResult.stop = false;
+                m_temporalResult.Stop = false;
                 groupHead = segmentGroupHeads[key + 1];
             }
-            m_temporalResult.groupHead = groupHead;
+            m_temporalResult.GroupHead = groupHead;
         }
 
         public override void SetNextReader(AtomicReaderContext context)
@@ -350,15 +354,15 @@ namespace Lucene.Net.Search.Grouping.Terms
             foreach (GroupHead collectedGroup in collectedGroups)
             {
                 int ord;
-                if (collectedGroup.groupValue == null)
+                if (collectedGroup.GroupValue == null)
                 {
                     ord = -1;
                 }
                 else
                 {
-                    ord = groupIndex.LookupTerm(collectedGroup.groupValue);
+                    ord = groupIndex.LookupTerm(collectedGroup.GroupValue);
                 }
-                if (collectedGroup.groupValue == null || ord >= 0)
+                if (collectedGroup.GroupValue == null || ord >= 0)
                 {
                     ordSet.Put(ord);
                     segmentGroupHeads[ord + 1] = collectedGroup;
@@ -390,7 +394,11 @@ namespace Lucene.Net.Search.Grouping.Terms
             private readonly OrdScoreAllGroupHeadsCollector outerInstance;
             // LUCENENET: Moved groupValue here from the base class, AbstractAllGroupHeadsCollector_GroupHead
so it doesn't
             // need to reference the generic closing type BytesRef.
-            public readonly BytesRef groupValue;
+            public BytesRef GroupValue
+            {
+                get { return groupValue; }
+            }
+            private readonly BytesRef groupValue;
 
             internal BytesRef[] sortValues;
             internal int[] sortOrds;
@@ -545,14 +553,14 @@ namespace Lucene.Net.Search.Grouping.Terms
                 groupHead = new GroupHead(this, doc, term);
                 collectedGroups.Add(groupHead);
                 segmentGroupHeads[key + 1] = groupHead;
-                m_temporalResult.stop = true;
+                m_temporalResult.Stop = true;
             }
             else
             {
-                m_temporalResult.stop = false;
+                m_temporalResult.Stop = false;
                 groupHead = segmentGroupHeads[key + 1];
             }
-            m_temporalResult.groupHead = groupHead;
+            m_temporalResult.GroupHead = groupHead;
         }
 
         public override void SetNextReader(AtomicReaderContext context)
@@ -570,15 +578,15 @@ namespace Lucene.Net.Search.Grouping.Terms
             foreach (GroupHead collectedGroup in collectedGroups)
             {
                 int groupOrd;
-                if (collectedGroup.groupValue == null)
+                if (collectedGroup.GroupValue == null)
                 {
                     groupOrd = -1;
                 }
                 else
                 {
-                    groupOrd = groupIndex.LookupTerm(collectedGroup.groupValue);
+                    groupOrd = groupIndex.LookupTerm(collectedGroup.GroupValue);
                 }
-                if (collectedGroup.groupValue == null || groupOrd >= 0)
+                if (collectedGroup.GroupValue == null || groupOrd >= 0)
                 {
                     ordSet.Put(groupOrd);
                     segmentGroupHeads[groupOrd + 1] = collectedGroup;
@@ -605,7 +613,11 @@ namespace Lucene.Net.Search.Grouping.Terms
             private readonly OrdAllGroupHeadsCollector outerInstance;
             // LUCENENET: Moved groupValue here from the base class, AbstractAllGroupHeadsCollector_GroupHead
so it doesn't
             // need to reference the generic closing type BytesRef.
-            public readonly BytesRef groupValue;
+            public BytesRef GroupValue
+            {
+                get { return groupValue; }
+            }
+            private readonly BytesRef groupValue;
             internal BytesRef[] sortValues;
             internal int[] sortOrds;
 
@@ -728,14 +740,14 @@ namespace Lucene.Net.Search.Grouping.Terms
                 groupHead = new GroupHead(this, doc, term);
                 collectedGroups.Add(groupHead);
                 segmentGroupHeads[key + 1] = groupHead;
-                m_temporalResult.stop = true;
+                m_temporalResult.Stop = true;
             }
             else
             {
-                m_temporalResult.stop = false;
+                m_temporalResult.Stop = false;
                 groupHead = segmentGroupHeads[key + 1];
             }
-            m_temporalResult.groupHead = groupHead;
+            m_temporalResult.GroupHead = groupHead;
         }
         public override void SetNextReader(AtomicReaderContext context)
         {
@@ -748,15 +760,15 @@ namespace Lucene.Net.Search.Grouping.Terms
             foreach (GroupHead collectedGroup in collectedGroups)
             {
                 int ord;
-                if (collectedGroup.groupValue == null)
+                if (collectedGroup.GroupValue == null)
                 {
                     ord = -1;
                 }
                 else
                 {
-                    ord = groupIndex.LookupTerm(collectedGroup.groupValue);
+                    ord = groupIndex.LookupTerm(collectedGroup.GroupValue);
                 }
-                if (collectedGroup.groupValue == null || ord >= 0)
+                if (collectedGroup.GroupValue == null || ord >= 0)
                 {
                     ordSet.Put(ord);
                     segmentGroupHeads[ord + 1] = collectedGroup;
@@ -769,7 +781,11 @@ namespace Lucene.Net.Search.Grouping.Terms
             private readonly ScoreAllGroupHeadsCollector outerInstance;
             // LUCENENET: Moved groupValue here from the base class, AbstractAllGroupHeadsCollector_GroupHead
so it doesn't
             // need to reference the generic closing type BytesRef.
-            public readonly BytesRef groupValue;
+            public BytesRef GroupValue
+            {
+                get { return groupValue; }
+            }
+            private readonly BytesRef groupValue;
             internal float[] scores;
 
             internal GroupHead(ScoreAllGroupHeadsCollector outerInstance, int doc, BytesRef
groupValue)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/378f1f12/src/Lucene.Net.Grouping/Term/TermSecondPassGroupingCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Grouping/Term/TermSecondPassGroupingCollector.cs b/src/Lucene.Net.Grouping/Term/TermSecondPassGroupingCollector.cs
index c84af50..a0924a6 100644
--- a/src/Lucene.Net.Grouping/Term/TermSecondPassGroupingCollector.cs
+++ b/src/Lucene.Net.Grouping/Term/TermSecondPassGroupingCollector.cs
@@ -53,8 +53,8 @@ namespace Lucene.Net.Search.Grouping.Terms
             foreach (AbstractSecondPassGroupingCollector.SearchGroupDocs<BytesRef>
group in m_groupMap.Values)
             {
                 //      System.out.println("  group=" + (group.groupValue == null ? "null"
: group.groupValue.utf8ToString()));
-                int ord = group.groupValue == null ? -1 : index.LookupTerm(group.groupValue);
-                if (group.groupValue == null || ord >= 0)
+                int ord = group.GroupValue == null ? -1 : index.LookupTerm(group.GroupValue);
+                if (group.GroupValue == null || ord >= 0)
                 {
                     m_groupDocs[ordSet.Put(ord)] = group;
                 }


Mime
View raw message