【发布时间】:2019-11-17 17:45:52
【问题描述】:
我正在从浏览器 URL 中删除文档。
我正在使用 Solr-7.4.0
我正在使用这个查询来删除文档
http://localhost:8983/solr/test/update?stream.body=<delete><query>*:*</query></delete>&commit=true
这是返回错误信息。
{
"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>'
但没有运气。 这将返回以下消息:
{
"responseHeader":{
"status":0,
"QTime":1}}
但文件没有删除。
我正在使用 DIH 导入数据。
我的 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>
【问题讨论】: