简体   繁体   English

Solr将字符串字段更改为整数多值

[英]Solr Change string field to integer multivalued

Background: I executed sharding by year in my statistics solr core, using a dspace command: 背景:我使用dspace命令在统计solr内核中按年执行了分片:

[dspace]/bin/dspace stats-util -s

According to: https://wiki.duraspace.org/display/DSDOC5x/SOLR+Statistics+Maintenance#SOLRStatisticsMaintenance-SolrShardingByYear 根据: https : //wiki.duraspace.org/display/DSDOC5x/SOLR+Statistics+Maintenance#SOLRStatisticsMaintenance-SolrShardingByYear

After that, there are several cores, divided by year: statistics, statistics-2015, statistics-2014, and so on. 之后,有几个核心,按年份划分:统计,2015年统计,2014年统计等。

However, multivalued fields are incorrect now, they seem to be a string: 但是,多值字段现在不正确,它们似乎是一个字符串:

"owningComm": [
      "8,2,1,2,1,1"
]

When we try to query, for example, owningComm:1 no results are given. 例如,当我们尝试查询owningComm:1时,没有给出结果。

The correct behaviour, before sharding, was as an "array" of integers: 分片之前,正确的行为是作为整数的“数组”:

"owningComm": [
      5,
      2,
      1,
      2,
      1,
      1
]

The field in schema.xml of Solr 4 is: Solr 4的schema.xml中的字段是:

<field name="owningComm" type="integer" 
       indexed="true" stored="true" 
       required="false" multiValued="true" />`

I already tried to tokenize the string with commas, but without success. 我已经尝试用逗号标记字符串,但是没有成功。

Is there any way to update this field to integers again? 有什么办法可以将该字段再次更新为整数? Removing the quotes or something like that? 删除引号或类似的东西?

We have millions docs stored. 我们存储了数百万个文档。

I took a look at my some of my shard data, and I see the same result that you have reported. 我查看了我的一些分片数据,并看到了与您报告的结果相同的结果。 Interestingly, after the upgrade to either DSpace 4 or DSpace 5, I remember that I was unable to search by owningComm. 有趣的是,升级到DSpace 4或DSpace 5后,我记得我无法通过ownerComm进行搜索。 I had presumed that this field had been dropped. 我以为该字段已删除。 Now I suspect that this issue you have reported was the underlying cause. 现在,我怀疑您报告的此问题是根本原因。

I recommend reporting this issue as a DSpace bug: https://jira.duraspace.org/projects/DS/issues 我建议将此问题报告为DSpace错误: https : //jira.duraspace.org/projects/DS/issues

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

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