我正在尝试对 ektron 搜索结果项的结果集进行分组并将它们输出到屏幕上,我使用以下代码
var groupdResults =
from result in response.Results
orderby result[SearchSmartFormProperty.GetDateProperty("/root/FundClosingDate")]
group result by result[SearchSmartFormProperty.GetStringProperty("/root/DeadlineAltText")]
into statusGroup
select new
{
closingDate =statusGroup.Key,
count= statusGroup.Count
};
然后我将这些添加到列表视图中: uxSearchResultView.DataSource = groupdResults;
我遇到的问题是我需要从结果集中输出所有数据,例如标题、关闭日期等,它目前只输出,例如关闭 2 打开 1
非常感谢任何人可以提供的任何帮助
- - - - - - - - - - - -更新 - - - - - - - - - - - - - ------------ 我想我现在有一个可行的解决方案,但它有点乱
var groupdResults = from result in response.Results
orderby result[SearchSmartFormProperty.GetDateProperty("/root/FundClosingDate")]
group result by result[SearchSmartFormProperty.GetStringProperty("/root/DeadlineAltText")]
into statusGroup
select new
{
closingDate = statusGroup.Key,
count = statusGroup.Count(),
items = statusGroup.ToList()
};
List<Ektron.Cms.Search.SearchResultData> SRDATA = new List<Ektron.Cms.Search.SearchResultData>();
foreach (var result in groupdResults)
{
for (int i = 0; i < result.items.Count; i++)
{
SRDATA.Add(result.items[i]);
}
}
关于更清洁的实施的任何意见?谢谢