9
我有一个Solr索引,它为每个产品的多值字段存储价格。使用Solr中的多值字段进行排序
我需要按价格对价格从低到高从高到低排序结果集。
我尝试使用排序价格显示错误您无法排序多值= True字段。
下面是我Solr的XML
<arr name="sellprice">
<float>195.0</float>
<float>136.5</float>
<float>10.0</float>
</arr>
schema.xml中
<field name="sellprice" type="float" indexed="true" stored="true" multiValued="true"/>
在C#代码
ISolrQueryResults<ProductTest2> powerArticles = solr.Query(new
SolrQuery("WebCategory_Id:10") && new SolrQueryInList("FilterID",
146), new QueryOptions { FilterQueries = new[] { new
SolrQueryByRange<decimal>("sellprice", 10, 40) }, OrderBy = new[] {
new SolrNet.SortOrder(sellprice, desc) } });
有人可以有一些很好的例子解释一下吗?
如果我选择低到高然后最低价格和高到低然后最大价格。 – Ashutosh
更新了答案,似乎没有直接的方法来做到这一点。 – Jayendra
感谢您的快速回复。我也发布了一个新的问题,请给我一个例子。 http://stackoverflow.com/questions/7846018/data-import-in-solr-from-multiple-entity – Ashutosh