对solr搜索结果进行排序.给出错误,无法对多值字段进行排序:名称 [英] sort the solr search result. give error can not sort on multivalued field: name
问题描述
我是Apache Solr搜索的新手.
I am newer to the Apache Solr search.
我正在尝试对Solr查询中的结果集进行排序. 查询:name:abc * AND隐藏:false& sort = name desc
I am trying to sort the result set in the Solr query. Query : name:abc* AND hidden:false & sort=name desc
显示错误: 无法在多值字段上排序:名称
It's showing the error : can not sort on the multivalued field: name
Solr版本为:7.2.1
Solr version is: 7.2.1
推荐答案
如果您正在使用Solr的最新版本(> 5.3),则应该可以使用min或max函数对多值文件进行排序,如下所示:
If you’re using recent versions of the Solr (>5.3) you should be able to use min or max functions to do sorting on multivalued fileds like this:
sort=field(field_to_sort_on,min) asc
实现此目标的唯一要求是在此字段上使用DocValues-这样就可以有效地在多值字段上找到最小值/最大值
The only requirement to achieve this is to use DocValues on this field - so finding minimum/maximum on multivalued field could be achieved efficiently
这篇关于对solr搜索结果进行排序.给出错误,无法对多值字段进行排序:名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!