简体   繁体   English

DSpace 7 - 向现有项目添加新元数据字段时没有建议

[英]DSpace 7 - No suggestions when adding a new metadata field to an existing item

In DSpace 7.4, while adding new metadata to an existing item I'm not getting any suggestions in the input box, is there any configuration step I'm missing?在 DSpace 7.4 中,在向现有项目添加新元数据时,我在输入框中没有收到任何建议,是否缺少任何配置步骤?

I can see it working in the official demo site here我可以在这里的官方演示网站上看到它的工作

I see in dspace.log that there is this API call when I type something in the input box:当我在输入框中键入内容时,我在dspace.log中看到有这个 API 调用:

GET /server/api/core/metadatafields/search/byFieldName 

so I tried this with no results: /server/#api/core/metadatafields/search/byFieldName?query=author The same API call in the DSpace 7 demo site returns 3 results: https://api7.dspace.org/server/#api/core/metadatafields/search/byFieldName?query=author所以我尝试了这个但没有结果:/server/#api/core/metadatafields/search/byFieldName?query=author DSpace 7 演示站点中的相同 API 调用返回 3 个结果: https://api7.dspace.org/server /#api/core/metadatafields/search/byFieldName?query=author

Also, in solr.log I see this call, which returns no hits:此外,在solr.log中,我看到了这个调用,它没有返回任何匹配项:

2023-01-11 13:09:55.709 INFO (qtp359742806-22) [ x:search] o.a.s.c.S.Request [search] webapp=/solr path=/select params={q=*:*&fl=search.resourcetype,search.resourceid,search.uniqueid,database_status&start=0&fq=fieldName_keyword:author*&fq=&wt=javabin&version=2} hits=0 status=0 QTime=1

Maybe there is a problem with SOLR?也许 SOLR 有问题?

Since it seemed to be a SOLR problem, I tried to reindex like this: dspace index-discovery -b , thus getting this error:由于它似乎是一个 SOLR 问题,我尝试像这样重新索引: dspace index-discovery -b ,因此出现此错误:

java.lang.NullPointerException: Cannot invoke "org.dspace.eperson.EPerson.getID()" because the return value of "org.dspace.authorize.ResourcePolicy.getEPerson()" is null
        at org.dspace.discovery.SolrServiceResourceRestrictionPlugin.additionalIndex(SolrServiceResourceRestrictionPlugin.java:95)
        at org.dspace.discovery.indexobject.IndexFactoryImpl.buildDocument(IndexFactoryImpl.java:67)
        at org.dspace.discovery.indexobject.InprogressSubmissionIndexFactoryImpl.buildDocument(InprogressSubmissionIndexFactoryImpl.java:46)
        at org.dspace.discovery.indexobject.WorkspaceItemIndexFactoryImpl.buildDocument(WorkspaceItemIndexFactoryImpl.java:63)
        at org.dspace.discovery.indexobject.WorkspaceItemIndexFactoryImpl.buildDocument(WorkspaceItemIndexFactoryImpl.java:30)
        at org.dspace.discovery.SolrServiceImpl.update(SolrServiceImpl.java:165)
        at org.dspace.discovery.SolrServiceImpl.indexContent(SolrServiceImpl.java:155)
        at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:340)
        at org.dspace.discovery.SolrServiceImpl.updateIndex(SolrServiceImpl.java:327)
        at org.dspace.discovery.IndexClient.internalRun(IndexClient.java:130)
        at org.dspace.scripts.DSpaceRunnable.run(DSpaceRunnable.java:104)
        at org.dspace.app.launcher.ScriptLauncher.executeScript(ScriptLauncher.java:149)
        at org.dspace.app.launcher.ScriptLauncher.handleScript(ScriptLauncher.java:131)
        at org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:98)

And found the solution here: https://groups.google.com/g/dspace-tech/c/ioukme4el9o .并在此处找到解决方案: https://groups.google.com/g/dspace-tech/c/ioukme4el9o

WARNING : It's recommended to test this in a development environment first.警告:建议首先在开发环境中对此进行测试。

The problem is that there was several rows with no eperson_id and no epersongroup_id in the resourcepolicy table.问题是resourcepolicy表中有几行没有eperson_idepersongroup_id So, I've deleted those rows with delete from resourcepolicy where eperson_id is null and epersongroup_id is null;所以,我用delete from resourcepolicy where eperson_id is null and epersongroup_id is null; and reindexed: dspace index-discovery -b .并重新编制索引: dspace index-discovery -b

Note : this problem seems to occur whenever the database comes from a dump of a previous DSpace version.注意:只要数据库来自以前 DSpace 版本的转储,似乎就会出现此问题。 In my case I restored a dump from a 5.6 version and migrated it to 7.4 before running into this issue.在我的例子中,我从 5.6 版本恢复了转储并将其迁移到 7.4,然后才遇到这个问题。

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

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