public static IEnumerable <T> GetSortedTopHits <T>(this AggregationsHelper aggs, Expression <Func <T, object> > sorter, SortType sortType) where T : class { var aggName = sortType + sorter.GetAggName(AggType.TopHits); var topHits = aggs.TopHits(aggName); return(topHits.Hits <T>().Select(x => x.Source)); }
public static IEnumerable <T> GetTopHits <T>(this AggregationsHelper aggs) where T : class { var topHits = aggs.TopHits(AggType.TopHits.ToString()); return(topHits.Hits <T>().Select(x => x.Source)); }