Skip to content

Commit c8d67d0

Browse files
committed
Add back removed XML comments during refactoring
1 parent 7ae04a6 commit c8d67d0

3 files changed

Lines changed: 67 additions & 0 deletions

File tree

src/Lucene.Net.Grouping/GroupDocs.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ public GroupDocs(float score, float maxScore, int totalHits, ScoreDoc[] scoreDoc
7575

7676
#region Explicit interface implementations
7777

78+
/// <summary>
79+
/// LUCENENET specific method to provide an object-based implementation of <see cref="GroupValue"/>.
80+
/// </summary>
81+
[SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
7882
object IGroupDocs.GroupValue => GroupValue;
7983

8084
#endregion
@@ -86,16 +90,38 @@ public GroupDocs(float score, float maxScore, int totalHits, ScoreDoc[] scoreDoc
8690
/// </summary>
8791
public interface IGroupDocs
8892
{
93+
/// <summary>
94+
/// The groupField value for all docs in this group; this
95+
/// may be null if hits did not have the groupField.
96+
/// </summary>
8997
object GroupValue { get; }
9098

99+
/// <summary>
100+
/// Max score in this group
101+
/// </summary>
91102
float MaxScore { get; }
92103

104+
/// <summary>
105+
/// Overall aggregated score of this group (currently only set by join queries).
106+
/// </summary>
93107
float Score { get; }
94108

109+
/// <summary>
110+
/// Hits; this may be <see cref="FieldDoc"/> instances if the
111+
/// withinGroupSort sorted by fields.
112+
/// </summary>
113+
[SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
95114
ScoreDoc[] ScoreDocs { get; }
96115

116+
/// <summary>
117+
/// Total hits within this group
118+
/// </summary>
97119
int TotalHits { get; }
98120

121+
/// <summary>
122+
/// Matches the groupSort passed to <see cref="AbstractFirstPassGroupingCollector{TGroupValue}"/>.
123+
/// </summary>
124+
[SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
99125
object[] GroupSortValues { get; }
100126
}
101127
}

src/Lucene.Net.Grouping/SearchGroup.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ public override int GetHashCode()
8282

8383
#region Explicit interface implementations
8484

85+
/// <summary>
86+
/// LUCENENET specific implementation to provide an object-based implementation of <see cref="GroupValue"/>.
87+
/// </summary>
8588
object ISearchGroup.GroupValue
8689
{
8790
get => GroupValue;
@@ -490,8 +493,20 @@ public static ICollection<SearchGroup<T>> Merge<T>(IList<ICollection<SearchGroup
490493
/// </summary>
491494
public interface ISearchGroup
492495
{
496+
/// <summary>
497+
/// The value that defines this group
498+
/// </summary>
493499
object GroupValue { get; set; }
494500

501+
/// <summary>
502+
/// The sort values used during sorting. These are the
503+
/// groupSort field values of the highest rank document
504+
/// (by the groupSort) within the group. Can be
505+
/// <c>null</c> if <c>fillFields=false</c> had
506+
/// been passed to <see cref="AbstractFirstPassGroupingCollector{TGroupValue}.GetTopGroups(int, bool)"/>
507+
/// </summary>
508+
[SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
509+
[WritableArray]
495510
object[] SortValues { get; set; }
496511
}
497512
}

src/Lucene.Net.Grouping/TopGroups.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ public TopGroups(TopGroups<TGroupValue> oldTopGroups, int? totalGroupCount)
9090

9191
#region Explicit interface implementations
9292

93+
/// <summary>
94+
/// LUCENENET specific method to provide an <see cref="IGroupDocs"/>-based implementation of <see cref="Groups"/>.
95+
/// </summary>
9396
IList<IGroupDocs> ITopGroups.Groups => new CastingListAdapter<GroupDocs<TGroupValue>, IGroupDocs>(Groups);
9497

9598
#endregion
@@ -281,23 +284,46 @@ public static TopGroups<T> Merge<T>(TopGroups<T>[] shardGroups, Sort groupSort,
281284
/// </summary>
282285
public interface ITopGroups
283286
{
287+
/// <summary>
288+
/// Number of documents matching the search
289+
/// </summary>
284290
int TotalHitCount { get; }
285291

292+
/// <summary>
293+
/// Number of documents grouped into the topN groups
294+
/// </summary>
286295
int TotalGroupedHitCount { get; }
287296

297+
/// <summary>
298+
/// The total number of unique groups. If <c>null</c> this value is not computed.
299+
/// </summary>
288300
int? TotalGroupCount { get; }
289301

290302
/// <summary>
303+
/// Group results in groupSort order
304+
/// <para />
291305
/// LUCENENET specific - this uses IList instead of an array
292306
/// as it would require a new array to be created each time
293307
/// the property is accessed.
294308
/// </summary>
295309
IList<IGroupDocs> Groups { get; }
296310

311+
/// <summary>
312+
/// How groups are sorted against each other
313+
/// </summary>
314+
[SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
297315
SortField[] GroupSort { get; }
298316

317+
/// <summary>
318+
/// How docs are sorted within each group
319+
/// </summary>
320+
[SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
299321
SortField[] WithinGroupSort { get; }
300322

323+
/// <summary>
324+
/// Highest score across all hits, or
325+
/// <see cref="float.NaN"/> if scores were not computed.
326+
/// </summary>
301327
float MaxScore { get; }
302328
}
303329
}

0 commit comments

Comments
 (0)