让我们假设我有以下索引定义:
public class LastSuspensions: AbstractIndexCreationTask<Casino, LastSuspensions.ReduceResult>
{
public class ReduceResult
{
public string CityId { get; set; }
public DateTime DateTime { get; set; }
public string CasinoId { get; set; }
public IList<Exemption> Exemptions { get; set; }
}
public LastSuspensions()
{
Map = casinos => from casino in casinos
from suspension in casino.Suspensions
select new { CityId = casino.CityId, DateTime = suspension.DateTime, CasinoId = casino.Id, Exemptions = suspension.Exemptions };
Store(x => x.CityId, FieldStorage.Yes);
Store(x => x.DateTime, FieldStorage.Yes);
Store(x => x.CasinoId, FieldStorage.Yes);
Store(x => x.Exemptions, FieldStorage.Yes);
}
有没有办法指定我想让Exemptions集合按其属性之一进行排序?