diff --git a/src/Lucene.Net.Grouping/GroupDocs.cs b/src/Lucene.Net.Grouping/GroupDocs.cs
index 2e50e7fe0b..d065f6b850 100644
--- a/src/Lucene.Net.Grouping/GroupDocs.cs
+++ b/src/Lucene.Net.Grouping/GroupDocs.cs
@@ -75,6 +75,10 @@ public GroupDocs(float score, float maxScore, int totalHits, ScoreDoc[] scoreDoc
#region Explicit interface implementations
+ ///
+ /// LUCENENET specific method to provide an object-based implementation of .
+ ///
+ [SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
object IGroupDocs.GroupValue => GroupValue;
#endregion
@@ -86,16 +90,38 @@ public GroupDocs(float score, float maxScore, int totalHits, ScoreDoc[] scoreDoc
///
public interface IGroupDocs
{
+ ///
+ /// The groupField value for all docs in this group; this
+ /// may be null if hits did not have the groupField.
+ ///
object GroupValue { get; }
+ ///
+ /// Max score in this group
+ ///
float MaxScore { get; }
+ ///
+ /// Overall aggregated score of this group (currently only set by join queries).
+ ///
float Score { get; }
+ ///
+ /// Hits; this may be instances if the
+ /// withinGroupSort sorted by fields.
+ ///
+ [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
ScoreDoc[] ScoreDocs { get; }
+ ///
+ /// Total hits within this group
+ ///
int TotalHits { get; }
+ ///
+ /// Matches the groupSort passed to .
+ ///
+ [SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
object[] GroupSortValues { get; }
}
}
diff --git a/src/Lucene.Net.Grouping/SearchGroup.cs b/src/Lucene.Net.Grouping/SearchGroup.cs
index 5f728c68ec..b007a56d6a 100644
--- a/src/Lucene.Net.Grouping/SearchGroup.cs
+++ b/src/Lucene.Net.Grouping/SearchGroup.cs
@@ -82,6 +82,9 @@ public override int GetHashCode()
#region Explicit interface implementations
+ ///
+ /// LUCENENET specific implementation to provide an object-based implementation of .
+ ///
object ISearchGroup.GroupValue
{
get => GroupValue;
@@ -490,8 +493,20 @@ public static ICollection> Merge(IList
public interface ISearchGroup
{
+ ///
+ /// The value that defines this group
+ ///
object GroupValue { get; set; }
+ ///
+ /// 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
+ /// null if fillFields=false had
+ /// been passed to
+ ///
+ [SuppressMessage("Microsoft.Performance", "CA1819", Justification = "Lucene's design requires some writable array properties")]
+ [WritableArray]
object[] SortValues { get; set; }
}
}
diff --git a/src/Lucene.Net.Grouping/TopGroups.cs b/src/Lucene.Net.Grouping/TopGroups.cs
index 1c018ffe0c..b1556732c2 100644
--- a/src/Lucene.Net.Grouping/TopGroups.cs
+++ b/src/Lucene.Net.Grouping/TopGroups.cs
@@ -90,6 +90,9 @@ public TopGroups(TopGroups oldTopGroups, int? totalGroupCount)
#region Explicit interface implementations
+ ///
+ /// LUCENENET specific method to provide an -based implementation of .
+ ///
IList ITopGroups.Groups => new CastingListAdapter, IGroupDocs>(Groups);
#endregion
@@ -281,23 +284,46 @@ public static TopGroups Merge(TopGroups[] shardGroups, Sort groupSort,
///
public interface ITopGroups
{
+ ///
+ /// Number of documents matching the search
+ ///
int TotalHitCount { get; }
+ ///
+ /// Number of documents grouped into the topN groups
+ ///
int TotalGroupedHitCount { get; }
+ ///
+ /// The total number of unique groups. If null this value is not computed.
+ ///
int? TotalGroupCount { get; }
///
+ /// Group results in groupSort order
+ ///
/// 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.
///
IList Groups { get; }
+ ///
+ /// How groups are sorted against each other
+ ///
+ [SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
SortField[] GroupSort { get; }
+ ///
+ /// How docs are sorted within each group
+ ///
+ [SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Lucene's design requires some array properties")]
SortField[] WithinGroupSort { get; }
+ ///
+ /// Highest score across all hits, or
+ /// if scores were not computed.
+ ///
float MaxScore { get; }
}
}