From 5fe9f7d44f554142efab7e9cb6b35eafdefd66df Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Sun, 15 Dec 2024 16:24:08 -0700 Subject: [PATCH] Add IAbstractGroupingSearch interface for symmetry with the other types --- src/Lucene.Net.Grouping/GroupingSearch.cs | 49 ++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/src/Lucene.Net.Grouping/GroupingSearch.cs b/src/Lucene.Net.Grouping/GroupingSearch.cs index c5d471c926..421b7c9aa2 100644 --- a/src/Lucene.Net.Grouping/GroupingSearch.cs +++ b/src/Lucene.Net.Grouping/GroupingSearch.cs @@ -447,6 +447,10 @@ public override TopGroups Search(IndexSearcher searcher, Filter filter, Query /// Abstract base class for grouping search implementations that groups documents by index terms or function. /// /// The type of the group value + /// + /// LUCENENET specific + /// + /// public abstract class AbstractFieldOrFunctionGroupingSearch : AbstractGroupingSearch { // LUCENENET: Converted to protected properties @@ -569,7 +573,11 @@ public virtual IBits GetAllGroupHeads() /// Abstract base class for grouping search implementations. /// /// The type of the group value - public abstract class AbstractGroupingSearch + /// + /// LUCENENET specific + /// + /// + public abstract class AbstractGroupingSearch : IAbstractGroupingSearch { // LUCENENET: Converted to protected properties protected Sort GroupSort { get; private set; } = Sort.RELEVANCE; @@ -671,5 +679,44 @@ public virtual AbstractGroupingSearch SetIncludeScores(bool includeScores) this.IncludeScores = includeScores; return this; } + + #region Explicit interface implementations + + /// + ITopGroups IAbstractGroupingSearch.Search(IndexSearcher searcher, Query query, int groupOffset, int groupLimit) + => Search(searcher, query, groupOffset, groupLimit); + + /// + ITopGroups IAbstractGroupingSearch.Search(IndexSearcher searcher, Filter filter, Query query, int groupOffset, int groupLimit) + => Search(searcher, filter, query, groupOffset, groupLimit); + + #endregion + } + + /// + /// LUCENENET specific interface for non-generic access to . + /// + public interface IAbstractGroupingSearch + { + /// + /// Executes a grouped search. Both the first pass and second pass are executed on the specified searcher. + /// + /// The instance to execute the grouped search on. + /// The query to execute with the grouping + /// The group offset + /// The number of groups to return from the specified group offset + /// the grouped result as an instance + ITopGroups Search(IndexSearcher searcher, Query query, int groupOffset, int groupLimit); + + /// + /// Executes a grouped search. Both the first pass and second pass are executed on the specified searcher. + /// + /// The instance to execute the grouped search on. + /// The filter to execute with the grouping + /// The query to execute with the grouping + /// The group offset + /// The number of groups to return from the specified group offset + /// the grouped result as an instance + ITopGroups Search(IndexSearcher searcher, Filter filter, Query query, int groupOffset, int groupLimit); } }