我为RavenDB创建了以下索引。
public class DayOfMonths_AllDaysSortedByOrder : AbstractIndexCreationTask<DayOfMonth, DayOfMonth>
{
public DayOfMonths_AllDaysSortedByOrder()
{
Map = days => from day in days select new { day };
Sort(x => x.Order, Raven.Abstractions.Indexing.SortOptions.Int);
}
}
但是,当我获取此索引的文档时,它们不会按正确的排序顺序返回。我做错了什么?
答案 0 :(得分:4)
你的地图线可能是这样吗?
Map = days => from day in days select new { day.Order };