0

I want to use a bat file to clear my index in solr. I found the following solution: https://superuser.com/questions/134685/run-curl-commands-from-windows-console

I downloaded cURL and a copied to my system32 folder. then I openend my windows commandline and typed curl www.google.com and it seems to work fine.

then I tried to add the following command:

curl http://berserkerpc:444/solr/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'

here the how to from solr: http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F

I got the message back that there is a a syntactic issue with '<' while processing.

here is the complete bat file I want to create:

curl http://berserkerpc:444/solr/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'  
curl http://berserkerpc:444/solr/update --data '<commit/>' -H 'Content-type:text/xml; charset=utf-8'

any suggestion how to solve this???

4

1 回答 1

1

使用 Curl 尝试调用 -

curl -H 'Content-Type: text/xml' http://localhost:8983/solr/update --data-binary '<delete><query>*:*</query></delete>'

请务必使用 commit=true 来反映这些更改。

或直接从浏览器 -

http://localhost:8983/solr/update?stream.body=<delete><query>*:*</query></delete>&commit=true
于 2013-03-28T10:11:20.300 回答