Skip to content

Commit

Permalink
Add back removed XML comments during refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Jan 1, 2025
1 parent 306766b commit 833aea3
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Lucene.Net.Grouping/GroupDocs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ public GroupDocs(float score, float maxScore, int totalHits, ScoreDoc[] scoreDoc

#region Explicit interface implementations

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

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

/// <summary>
/// Max score in this group
/// </summary>
float MaxScore { get; }

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

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

/// <summary>
/// Total hits within this group
/// </summary>
int TotalHits { get; }

/// <summary>
/// Matches the groupSort passed to <see cref="AbstractFirstPassGroupingCollector{TGroupValue}"/>.
/// </summary>
[SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
object[] GroupSortValues { get; }
}
}
15 changes: 15 additions & 0 deletions src/Lucene.Net.Grouping/SearchGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public override int GetHashCode()

#region Explicit interface implementations

/// <summary>
/// LUCENENET specific implementation to provide an object-based implementation of <see cref="GroupValue"/>.
/// </summary>
object ISearchGroup.GroupValue
{
get => GroupValue;
Expand Down Expand Up @@ -490,8 +493,20 @@ public static ICollection<SearchGroup<T>> Merge<T>(IList<ICollection<SearchGroup
/// </summary>
public interface ISearchGroup
{
/// <summary>
/// The value that defines this group
/// </summary>
object GroupValue { get; set; }

/// <summary>
/// The sort values used during sorting. These are the
/// groupSort field values of the highest rank document
/// (by the groupSort) within the group. Can be
/// <c>null</c> if <c>fillFields=false</c> had
/// been passed to <see cref="AbstractFirstPassGroupingCollector{TGroupValue}.GetTopGroups(int, bool)"/>
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
[WritableArray]
object[] SortValues { get; set; }
}
}
26 changes: 26 additions & 0 deletions src/Lucene.Net.Grouping/TopGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public TopGroups(TopGroups<TGroupValue> oldTopGroups, int? totalGroupCount)

#region Explicit interface implementations

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

#endregion
Expand Down Expand Up @@ -281,23 +284,46 @@ public static TopGroups<T> Merge<T>(TopGroups<T>[] shardGroups, Sort groupSort,
/// </summary>
public interface ITopGroups
{
/// <summary>
/// Number of documents matching the search
/// </summary>
int TotalHitCount { get; }

/// <summary>
/// Number of documents grouped into the topN groups
/// </summary>
int TotalGroupedHitCount { get; }

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

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

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

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

/// <summary>
/// Highest score across all hits, or
/// <see cref="float.NaN"/> if scores were not computed.
/// </summary>
float MaxScore { get; }
}
}

0 comments on commit 833aea3

Please sign in to comment.