solr - Solr error - Stream Body is disabled
问题描述
I'm deleting documents from browser URL.
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}}
I also tried with
http://localhost:8983/solr/test/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
but not get any luck. This return below message:
{
"responseHeader":{
"status":0,
"QTime":1}}
but documents not deleting.
I'm using DIH for import data.
my data-config.xml file is
<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 正文:
{
"set-property": [{
"requestDispatcher.requestParsers.enableRemoteStreaming": true
},
{
"requestDispatcher.requestParsers.enableStreamBody": true
}
]
}
网址: http://localhost:8983/api/cores/test5/config
之后运行以下 URL:
http://localhost:8983/solr/test5/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E&commit=true
它工作正常。
推荐阅读
- html - 在 HTML/CSS 中访问链接时使图像变为灰度
- angular - 添加解析器和动态布局组合后,Angular 8 组件不显示
- selenium - 获取“无法启动 Selenium 侦听器”。通过 saucelabs 运行 testcafe 脚本时出现错误消息
- android - 如何设置此微调器文本的字体(字体)?
- django - Django crispy-forms:带有 TextArea 字段的 2 列表单
- sql - 使用 SQL 检索已订购商品的总数量
- sql - 在 Oracle 中使用 PARTITION BY 对行进行分组
- migration - 我是否需要将操作迁移到不使用 Dialogflow 的 v2?
- node.js - 为什么在 Express Node JS 中同时请求相同的路由时集群不起作用?
- c++ - 编译器会简化按顺序执行多次的操作吗?