【发布时间】:2017-11-27 17:47:40
【问题描述】:
我一直在使用 SOLR 4.10.2,并准备迁移到 7.1
在 4.10.2 下,我能够使用以下内容清除索引:
var address = @"http://mysolrserver:8983/solr/mysolrcore/update?stream.body=<delete><query>(*:*)</query></delete>&commit=true";
WebClient client = new WebClient();
client.DownloadString(address).Dump();
当我在 SOLR 7.1 服务器上尝试此操作时,我收到响应 400 - Bad request。
{
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"Stream Body is disabled. See http://lucene.apache.org/solr/guide/requestdispatcher-in-solrconfig.html for help",
"code":400}}
我进入 solrconfig.xml 作为核心并将元素设置为
<requestParsers enableRemoteStreaming="true"
multipartUploadLimitInKB="2048000"
formdataUploadLimitInKB="2048"
addHttpRequestToContext="false"/>
但我仍然遇到同样的错误。
由于7.1现在默认是json,我已经尝试添加
&wt=xml
到 url 的末尾,但我得到相同的结果:400 - Bad Request
有什么想法吗?
【问题讨论】:
标签: solr