发现了具有类似问题的帖子。作为其旧线程发布为新线程。 Can't find resource 'solrconfig.xml' in classpath in solr
尝试从API创建Solr CORE时遇到错误。
{
"responseHeader": {
"status": 400,
"QTime": 4
},
"error": {
"metadata": [
"error-class",
"org.apache.solr.common.SolrException",
"root-error-class",
"org.apache.solr.core.SolrResourceNotFoundException"
],
"msg": "Error CREATEing SolrCore 'coreX': Unable to create core [coreX] Caused by: Can't find resource 'config_file_name.xml' in classpath or '/home/batchhub/solr-7.4.0/server/solr/path_to_instance_directory'",
"code": 400
}
}
API
http://localhost:8983/solr/admin/cores?action=CREATE&name=coreX&instanceDir=path_to_instance_directory&
config=config_file_name.xml&schema=schema_file_name.xml&dataDir=data
如何解决此问题。
答案 0 :(得分:0)
instanceDir
中的 CREATE
参数应引用真实路径,而不是path_to_instance_directory
。与config
参数相同。