错误404:Prob访问/ solr / update。原因:未找到

时间:2014-07-09 13:25:21

标签: xml solr lucene

我已经跟随solr tutorial并将默认的collection1重命名为core1,但是当我在尝试使用以下命令将XML导入solr时出现错误404:

curl http://127.0.0.1:8983/solr/update --data-binary @monitor.xml -H 'Content-type:application/xml'

以下是回复:

<h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/update. Reason:
<pre>    Not Found</pre></p><hr /><i><small>Powered by Jetty://</small></i>

2 个答案:

答案 0 :(得分:22)

如果将集合重命名为core1,则应运行此命令:

curl http://127.0.0.1:8983/solr/core1/update --data-binary @monitor.xml -H 'Content-type:application/xml'

也就是说,在“solr”和动作之间添加集合名称 - 同样适用于查询:

http://localhost:8983/solr/core1/select?q=solr&wt=xml

答案 1 :(得分:2)

我正在使用SolrNet,我得到了同样的错误。 我做的是:

  • 使用产品运行Solr:$solr-5.5.0\bin>solr start -e techproducts
  • 更改SolrNet示例应用程序
    • web.config SolrUrlhttp://localhost:8983/solrhttp://localhost:8983/solr/techproducts
    • Global.asax.cs 注释掉方法调用AddInitialDocuments()
  • 运行SolrNet示例应用程序