无法使用SimplePostTool在solr中发布到核心

Ade*_*eeb 9 solr

我是使用solr的新手.我目前正在运行solr http://localhost::8983/solr.我的目标是索引大量文件.我已经通过在solr中列出所有核心来验证我试图发布的核心存在,我使用了这里解释的方法

我也明白要使用SimplePostTool发布到特定核心,必须使用 java -Durl=http://localhost:8983/solr/<corename>/update -jar post.jar <filename>

但是,问题是我收到以下错误.

SimplePostTool version 1.5
Posting files to base url http://localhost:8983/solr/collection1/update using content-type application/xml..
POSTing file tmpzWztTN
SimplePostTool: WARNING: Solr returned an error #404 Not Found
SimplePostTool: WARNING: IOException while reading response: java.io.FileNotFoundException: http://localhost:8983/solr/collection1/update
1 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/collection1/update..
SimplePostTool: WARNING: Solr returned an error #404 Not Found for url http://localhost:8983/solr/collection1/update?commit=true
Time spent: 0:00:00.023
Run Code Online (Sandbox Code Playgroud)

既然我已经验证了核心collection1存在,为什么它说不能找到网址呢?我错过了什么?如何解决这个问题?

小智 14

它看起来像'开始'核心没有被创建.使用此命令创建"gettingstarted"核心.

bin/solr create -c gettingstarted

创建核心后,"bin/post -c gettingstarted docs /"命令运行时没有任何错误.


Ade*_*eeb 4

正如 @cheffe 的评论所示,事实证明我失踪了<requestHandler> name="/update" ...

我是一个 solr 菜鸟,所以我查了requestHandlers一下 这里。本教程也很有帮助。solrconfig.xml从本质上讲,我只在我的文件中添加了以下行

<requestHandler name="/update" class="solr.UpdateRequestHandler" />
Run Code Online (Sandbox Code Playgroud)