Initial commit

This commit is contained in:
2022-07-06 21:35:05 +02:00
commit b2494052ff
97220 changed files with 2449256 additions and 0 deletions
@@ -0,0 +1,31 @@
using System.Collections.Generic;
using System.Linq;
using Gos.Core.Search.Aggregations;
using Gos.ServiceModel.Enums;
using Gos.ServiceModel.Types;
namespace Gos.Services.Search.Aggregations
{
public class DiscourseYearAggregationProvider : BaseAggregationProvider
{
public DiscourseYearAggregationProvider(IAggregatorFactory aggregatorFactory)
: base(aggregatorFactory)
{
}
public override AggregationType Type => AggregationType.DiscourseYear;
protected override List<AggregationItem> GetItems(IDictionary<string, int> items)
{
return (from item in items
let year = int.Parse(item.Key)
orderby item.Value descending, year
select new AggregationItem()
{
Count = item.Value,
Key = year,
Title = year.ToString(),
}).ToList();
}
}
}