我可以通過運行以下命令來創建一個新的內核。創建新內核的命令與API之間有什麼區別?
$ ./bin/solr create -c newcore
Setup new core instance directory:
/Users/myname/Documents/solr/solr-5.2.1/server/solr/newcore
Creating new core 'newcore' using command:
http://localhost:8983/solr/admin/cores?action=CREATE&name=newcore&instanceDir=newcore
{
"responseHeader":{
"status":0,
"QTime":916},
"core":"newcore"}
但是,我無法通過消息說的API創建新的內核。
$ curl -X GET 'http://localhost:8983/solr/admin/cores?action=CREATE&name=newcore2&instanceDir=newcore2'
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">400</int><int name="QTime">361</int></lst><lst name="error"><str name="msg">Error CREATEing SolrCore 'newcore2': Unable to create core [newcore2] Caused by: Can't find resource 'solrconfig.xml' in classpath or '/Users/myname/Documents/solr/solr-5.2.1/server/solr/newcore2/conf'</str><int name="code">400</int></lst>
</response>
這兩種創建核心的方式有什麼不同?我明白爲什麼會發生這種情況的錯誤。命令的過程與API的過程不一樣嗎? 我正在使用solr-5.2.1。