Ví dụ curl ở trên tất cả đều thất bại đối với tôi khi tôi chạy chúng từ thiết bị đầu cuối Cygwin. Có lỗi như thế này khi tôi chạy ví dụ kịch bản.
curl http://192.168.2.20:7773/solr/CORE1/update --data '<delete><query>*:*</query></delete>' -H 'Content-type:text/xml; charset=utf-8'
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">1</int></lst>
</response>
<!--
It looks like it deleted stuff, but it did not go away
maybe because the committing call failed like so
-->
curl http://192.168.1.2:7773/solr/CORE1/update --data-binary '' -H 'Content-type:text/xml; charset=utf-8'
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">400</int><int name="QTime">2</int></lst><lst name="error"><str name="msg">Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]</str><int name="code">400</int></lst>
</response>
Tôi cần sử dụng vòng lặp xóa trên tên lõi để xóa tất cả trong một dự án.
Truy vấn này bên dưới đã hoạt động đối với tôi trong tập lệnh thiết bị đầu cuối Cygwin.
curl http://192.168.1.2:7773/hpi/CORE1/update?stream.body=<delete><query>*:*</query></delete>&commit=true
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">1</int></lst>
</response>
Dòng này làm cho dữ liệu biến mất và thay đổi vẫn tiếp tục.
cốt lõi là cần thiết nếu bạn đang sử dụng thiết lập đa lõi. – Jayendra
Câu trả lời này thảo luận cách xóa tất cả các bảng trong HBase: http://stackoverflow.com/questions/3990952/a-script-that-deletes-all-tables-in-hbase. Nếu bạn chỉ muốn xóa dữ liệu trong bảng, bạn có thể cắt bớt chúng thay vì thả chúng. – codingFoo
hiện nó chỉ xóa chỉ mục? hoặc nó sẽ xóa dữ liệu thực? –