{"id":195,"date":"2010-11-01T15:56:43","date_gmt":"2010-11-01T14:56:43","guid":{"rendered":"http:\/\/daniel.hepper.net\/blog\/?p=195"},"modified":"2018-11-25T19:05:53","modified_gmt":"2018-11-25T18:05:53","slug":"howto-clear-solr-index","status":"publish","type":"post","link":"https:\/\/daniel.hepper.net\/blog\/2010\/11\/howto-clear-solr-index\/","title":{"rendered":"Howto clear Solr index"},"content":{"rendered":"<p>If you want to delete all items from Solr index, use the query<\/p>\n<pre><tt>&lt;delete&gt;&lt;query&gt;*:*&lt;\/query&gt;&lt;\/delete&gt;\r\n<\/tt><\/pre>\n<p>as described in the <a href=\"http:\/\/wiki.apache.org\/solr\/FAQ#How_can_I_delete_all_documents_from_my_index.3F\">FAQ on the Solr Wiki<\/a>.<\/p>\n<p>But how do you actually send this query? You can use this command:<\/p>\n<pre>curl http:\/\/&lt;host&gt;:&lt;port&gt;\/&lt;solr_base&gt;\/update?commit=true -d '&lt;delete&gt;&lt;query&gt;*:*&lt;\/query&gt;&lt;\/delete&gt;'<\/pre>\n<p>Just replace the placeholders with the right values, e.g.<\/p>\n<pre>curl http:\/\/localhost:8983\/solr\/update?commit=true -d  '&lt;delete&gt;&lt;query&gt;*:*&lt;\/query&gt;&lt;\/delete&gt;'<\/pre>\n<p>If Solr responds with something like this:<\/p>\n<pre><strong>HTTP Status 400 - missing content stream<\/strong>\r\nStatus report\r\n<strong>message<\/strong> missing content stream\r\n<strong>description<\/strong> The request sent by the client was syntactically incorrect (missing content stream).<\/pre>\n<p>then you are probably missing the commit parameter i.e. ?commit=true<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to delete all items from Solr index, use the query &lt;delete&gt;&lt;query&gt;*:*&lt;\/query&gt;&lt;\/delete&gt; as described in the FAQ on the Solr Wiki. But how do you actually send this query? You can use this command: curl http:\/\/&lt;host&gt;:&lt;port&gt;\/&lt;solr_base&gt;\/update?commit=true -d &#8216;&lt;delete&gt;&lt;query&gt;*:*&lt;\/query&gt;&lt;\/delete&gt;&#8217; &hellip; <a href=\"https:\/\/daniel.hepper.net\/blog\/2010\/11\/howto-clear-solr-index\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-195","post","type-post","status-publish","format-standard","hentry","category-howto"],"_links":{"self":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/comments?post=195"}],"version-history":[{"count":7,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/195\/revisions"}],"predecessor-version":[{"id":638,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/posts\/195\/revisions\/638"}],"wp:attachment":[{"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/media?parent=195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/categories?post=195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.hepper.net\/blog\/wp-json\/wp\/v2\/tags?post=195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}