【问题标题】:Clearing SOLR 7.1 index清除 SOLR 7.1 索引
【发布时间】: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


    【解决方案1】:

    您切换了错误的参数。如果你想在 URL 中允许stream.body,你必须设置enableStreamBody="true"enableRemoteStreaming 控制 stream.filestream.url,可用于从远程位置读取。

    【讨论】:

    【解决方案2】:

    删除查询后,我在邮递员的调用下运行正常。

    http://localhost:8983/solr/CORENAME/config -H 'Content-type:application/json' -d'{
        "set-property" : {"requestDispatcher.requestParsers.enableRemoteStreaming":true},
        "set-property" : {"requestDispatcher.requestParsers.enableStreamBody":true}
    }'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-25
      • 1970-01-01
      • 2013-06-09
      • 2014-02-18
      • 2017-07-26
      • 2015-11-25
      相关资源
      最近更新 更多