嗨,请告诉我如何在 solr 中应用多值排序顺序,这是我下面给出的代码,我为此使用 solr net。
private QueryOptions ConstructQueryOperation(SearchCriteria searchCriteria)
{
QueryOptions queryOption =new QueryOptions();
queryOption.Rows = searchCriteria.Pagination.PageSize;
queryOption.Start = ((searchCriteria.Pagination.CurrentPage+1) - 1) * searchCriteria.Pagination.PageSize;
if (searchCriteria.SortCriteria != null)
{
foreach (var sortItem in searchCriteria.SortCriteria)
{
if (sortItem.Value.ToString() == ListSorter.SortingOrder.Descending.ToString())
{
queryOption.AddOrder(new SolrNet.SortOrder(sortItem.Key, Order.DESC));
}
else
{
queryOption.AddOrder(new SolrNet.SortOrder(sortItem.Key, Order.ASC));
}
}
}
return queryOption;
}
我收到一个错误的服务器请求。谁能让我知道具体需要做什么。