简体   繁体   English

在SOLR 7.2.1上进行多值字段排序

[英]multivalued field sorting on SOLR 7.2.1

i use a server with solr 7.3.0 for testing. 我使用带有solr 7.3.0的服务器进行测试。 my scheme has some multivalued string fields like 我的方案有一些多值字符串字段,例如

<field name="rating" type="string" omitNorms="true" multiValued="true" indexed="true" stored="true"/>

On solr 7.3.0 a url query for sorting for the field "rating" works fine. 在solr 7.3.0上,对字段“评级”进行排序的url查询可以正常工作。 Something like this: 像这样:

server-name1:8983/sorl/core/search?q=*&sort=rating DESC 服务器名称1:8983 / sorl / core / search?q = *&sort = rating DESC

But recently i use a slave and the above mentioned solr 7.3.0 server is the master server. 但是最近我使用一个从属服务器,上面提到的solr 7.3.0服务器是主服务器。 The slave has a lesser version (7.2.1) installed. 从站已安装了较低版本(7.2.1)。 Because the server exists longer and this was was the latest version back then. 因为服务器存在时间更长,而这是当时的最新版本。 I never bothered to update this yet. 我从来没有想过要更新它。 But now the same query as above 但是现在与上面相同的查询

server-name2:8983/sorl/core/search?q=*&sort=rating DESC 服务器名称2:8983 / sorl / core / search?q = *&sort = rating DESC

returns a error message: 返回错误信息:

"msg":"can not sort on multivalued field:rating" “ msg”:“无法对多值字段进行排序:评级”

My question is: is this just a recently implemented feature or did i miss something? 我的问题是:这只是最近实施的功能还是我错过了什么? I could update to 7.3.0 for the slave as well, but it just want to be sure if this is just a version issue. 我也可以将奴隶也更新到7.3.0,但是它只是想确定这是否只是一个版本问题。

Yes, this was implemented for 7.3.0. 是的,这是针对7.3.0实施的。 See SOLR-11854 - multiValued PrimitiveFieldType should implicitly sort on min/max based on the asc/desc keyword . 请参阅SOLR-11854-multiValued PrimitiveFieldType应该基于asc / desc关键字对min / max进行隐式排序

To find out if something has changed between versions, refer to the changelog for the new version . 要了解版本之间是否有所更改,请参考新版本的变更日志。 This is listed under the "New features" section: 这在“新功能”部分下列出:

SOLR-11854: multivalued primitive fields can now be sorted by implicitly choosing the min/max value for asc/desc sort orders. SOLR-11854:现在可以通过隐式选择asc / desc排序顺序的最小值/最大值来对多值基本字段进行排序。 (hossman) (hossman)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM