对solr搜索结果进行排序.给出错误,无法对多值字段进行排序:名称 [英] sort the solr search result. give error can not sort on multivalued field: name

查看:161
本文介绍了对solr搜索结果进行排序.给出错误,无法对多值字段进行排序:名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆