Skip to content

Commit ffceff5

Browse files
committed
Add IAbstractGroupingSearch interface for symmetry with the other types
1 parent ee5d268 commit ffceff5

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

src/Lucene.Net.Grouping/GroupingSearch.cs

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ public override TopGroups<T> Search(IndexSearcher searcher, Filter filter, Query
447447
/// Abstract base class for grouping search implementations that groups documents by index terms or function.
448448
/// </summary>
449449
/// <typeparam name="T">The type of the group value</typeparam>
450+
/// <remarks>
451+
/// LUCENENET specific
452+
/// </remarks>
453+
/// <seealso cref="GroupingSearch"/>
450454
public abstract class AbstractFieldOrFunctionGroupingSearch<T> : AbstractGroupingSearch<T>
451455
{
452456
// LUCENENET: Converted to protected properties
@@ -569,7 +573,11 @@ public virtual IBits GetAllGroupHeads()
569573
/// Abstract base class for grouping search implementations.
570574
/// </summary>
571575
/// <typeparam name="T">The type of the group value</typeparam>
572-
public abstract class AbstractGroupingSearch<T>
576+
/// <remarks>
577+
/// LUCENENET specific
578+
/// </remarks>
579+
/// <seealso cref="GroupingSearch"/>
580+
public abstract class AbstractGroupingSearch<T> : IAbstractGroupingSearch
573581
{
574582
// LUCENENET: Converted to protected properties
575583
protected Sort GroupSort { get; private set; } = Sort.RELEVANCE;
@@ -671,5 +679,44 @@ public virtual AbstractGroupingSearch<T> SetIncludeScores(bool includeScores)
671679
this.IncludeScores = includeScores;
672680
return this;
673681
}
682+
683+
#region Explicit interface implementations
684+
685+
/// <inheritdoc cref="IAbstractGroupingSearch.Search(IndexSearcher, Query, int, int)"/>
686+
ITopGroups IAbstractGroupingSearch.Search(IndexSearcher searcher, Query query, int groupOffset, int groupLimit)
687+
=> Search(searcher, query, groupOffset, groupLimit);
688+
689+
/// <inheritdoc cref="IAbstractGroupingSearch.Search(IndexSearcher, Filter, Query, int, int)"/>
690+
ITopGroups IAbstractGroupingSearch.Search(IndexSearcher searcher, Filter filter, Query query, int groupOffset, int groupLimit)
691+
=> Search(searcher, filter, query, groupOffset, groupLimit);
692+
693+
#endregion
694+
}
695+
696+
/// <summary>
697+
/// LUCENENET specific interface for non-generic access to <see cref="AbstractGroupingSearch{T}"/>.
698+
/// </summary>
699+
public interface IAbstractGroupingSearch
700+
{
701+
/// <summary>
702+
/// Executes a grouped search. Both the first pass and second pass are executed on the specified searcher.
703+
/// </summary>
704+
/// <param name="searcher">The <see cref="IndexSearcher"/> instance to execute the grouped search on.</param>
705+
/// <param name="query">The query to execute with the grouping</param>
706+
/// <param name="groupOffset">The group offset</param>
707+
/// <param name="groupLimit">The number of groups to return from the specified group offset</param>
708+
/// <returns>the grouped result as an <see cref="ITopGroups"/> instance</returns>
709+
ITopGroups Search(IndexSearcher searcher, Query query, int groupOffset, int groupLimit);
710+
711+
/// <summary>
712+
/// Executes a grouped search. Both the first pass and second pass are executed on the specified searcher.
713+
/// </summary>
714+
/// <param name="searcher">The <see cref="IndexSearcher"/> instance to execute the grouped search on.</param>
715+
/// <param name="filter">The filter to execute with the grouping</param>
716+
/// <param name="query">The query to execute with the grouping</param>
717+
/// <param name="groupOffset">The group offset</param>
718+
/// <param name="groupLimit">The number of groups to return from the specified group offset</param>
719+
/// <returns>the grouped result as an <see cref="ITopGroups"/> instance</returns>
720+
ITopGroups Search(IndexSearcher searcher, Filter filter, Query query, int groupOffset, int groupLimit);
674721
}
675722
}

0 commit comments

Comments
 (0)