sort the solr search result. give error can not sort on multivalued field: name

橙三吉。 提交于 2019-12-23 17:16:08

问题


I am newer to the Apache Solr search.

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 version is: 7.2.1


回答1:


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

The only requirement to achieve this is to use DocValues on this field - so finding minimum/maximum on multivalued field could be achieved efficiently



来源:https://stackoverflow.com/questions/54091121/sort-the-solr-search-result-give-error-can-not-sort-on-multivalued-field-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!