Solr删除因某些原因无法正常工作

Bla*_*man 27 java search solr

只是试图删除所有文件,并做到了这一点:

http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E
Run Code Online (Sandbox Code Playgroud)

然后承诺:

http://localhost:8983/solr/update?stream.body=%3Ccommit/%3E
Run Code Online (Sandbox Code Playgroud)

我收到了回复:

<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">17</int>
</lst>
</response>
Run Code Online (Sandbox Code Playgroud)

但是当我搜索时,我仍然会得到结果.

我做错了什么?

mla*_*the 32

不确定它是否重要,但你可能编码:也

http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*%3A*%3C%2Fquery%3E%3C%2Fdelete%3E
Run Code Online (Sandbox Code Playgroud)

另一件要尝试的是使用POST方法(调用update的首选方法):

curl http://localhost:8983/solr/update?commit=true -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
Run Code Online (Sandbox Code Playgroud)

  • 然后,在运行此命令后,我运行了单独的"代码"(http:// localhost:8983/solr/update?stream.body = <commit />)命令.非常感谢 (2认同)

Rob*_*Rob 9

最近我也被这个蜇了.只要记住,如果你有updateLog在solrconfig.xml中配置,但没有版本在外地的schema.xml

请参阅https://issues.apache.org/jira/browse/SOLR-3432

我在这个上花了一个小时!


Tim*_*m P 6

将commit = true参数放在GET请求中:

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