Solr错误-流主体已禁用 [英] Solr error - Stream Body is disabled

查看:255
本文介绍了Solr错误-流主体已禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从浏览器URL中删除文档。

I'm deleting documents from browser URL.

我正在使用Solr-7.4.0

I'm using Solr-7.4.0

我正在使用此查询删除文档

I'm using this query for delete document

http://localhost:8983/solr/test/update?stream.body=<delete><query>*:*</query></delete>&commit=true

这是下面的错误消息返回。

This is return below error message.

{
  "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}}

我也尝试过

http://localhost:8983/solr/test/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'

,但不是ge运气不好。
以下消息返回:

but not get any luck. This return below message:

{
  "responseHeader":{
    "status":0,
    "QTime":1}}

,但文档未删除。

我正在使用DIH导入数据。

I'm using DIH for import data.

我的data-config.xml文件是

<dataConfig>
<dataSource type="JdbcDataSource" driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://127.0.0.1\SQL2017;databaseName=mydatabase"   user="sa" password="mypassword"/>

    <document>
      <entity name="Product"  
        pk="Id"
        query="select Id, [Name] from Product"
        deltaImportQuery="SELECT Id, [Name] from Product WHERE Id='${dih.delta.id}'"
        deltaQuery="SELECT Id FROM Product  WHERE updated_at > '${dih.last_index_time}'"
        >
         <field column="Id" name="Id"/>
         <field column="Name" name="Name"/>       
      </entity>
    </document>
</dataConfig>


推荐答案

我由邮递员

方法: POST
内容类型: application / json
正文:

Method: POST Content-Type: application/json Body:

{
    "set-property": [{
            "requestDispatcher.requestParsers.enableRemoteStreaming": true
        },
        {
            "requestDispatcher.requestParsers.enableStreamBody": true
        }
    ]
}

URL: http:// localhost:8983 / api / cores / test5 / config

之后在网址以下运行:

http://localhost:8983/solr/test5/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E&commit=true

,并且工作正常。

这篇关于Solr错误-流主体已禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆