27

Just trying to delete all the documents, and did this:

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

then committed:

http://localhost:8983/solr/update?stream.body=%3Ccommit/%3E

I get the response:

<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">17</int>
</lst>
</response>

But when I search I still get results back.

What did I do wrong?

5
  • where is the solr log, I couldn't find it! I'm running on jetty.
    – Blankman
    Mar 2, 2010 at 17:49
  • Never mind, if you have a response, there's no error. What's your client platform? If it's Java you could just use SolrJ, or is there any particular reason you're not using it? Mar 2, 2010 at 22:07
  • what docs do you get if you query *:* ?
    – Karussell
    Jun 5, 2010 at 19:26
  • 3
    If anyone is wondering, here is the SOLR docs on how to do these kind of deletions from a URL: wiki.apache.org/solr/UpdateXmlMessages
    – Aaron D
    Aug 10, 2010 at 17:11
  • For me this did not help, but be sure check the linked issue: stackoverflow.com/questions/12057734/… Sep 25, 2012 at 15:02

7 Answers 7

32

Not sure if it matters but you might encode the : too

http://localhost:8983/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*%3A*%3C%2Fquery%3E%3C%2Fdelete%3E

Another thing to try is to use the POST method (the preferred way to call update):

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

I got stung with this one recently as well. Just remember that if you have updateLog is configured in solrconfig.xml, but there is no version field in the schema.xml

see https://issues.apache.org/jira/browse/SOLR-3432

I Spent a good hour on this one!!!

1
  • Fantastic comment. This was exactly my issue.
    – Layke
    Jan 4, 2013 at 1:24
6

Put the commit=true parameter in you GET request:

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

2

Remember to clear the browser cache! I thought I was having the same problem, but it turned out that the browser had just cached the result and was returning the cached page. D'oh!

0

In Lucene wiki :

it will still be found, because index changes are not visible until, and a new searcher is opened. To cause this to happen, send a commit command to Solr (post.jar does this for you by default)

Maybe you can POST a <commit/> message to Solr.

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

Probably you are missing a forward slash (/) after update and before question mark.

Current query:

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

Revised query:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.