Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 262 Vote(s) - 3.42 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to delete all data from solr and hbase

#11
The curl examples above all failed for me when I ran them from a cygwin terminal. There were errors like this when i ran the script example.

curl

[To see links please register here]

--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

[To see links please register here]

--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>

I needed to use the delete in a loop on core names to wipe them all out in a project.

This query below worked for me in the Cygwin terminal script.

curl

[To see links please register here]

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int name="QTime">1</int></lst>
</response>

This one line made the data go away and the change persisted.
Reply

#12
I've used this query to delete all my records.

[To see links please register here]

Reply

#13
If you're using Cloudera 5.x, Here in this documentation is mentioned that Lily maintains the Real time updations and deletions also.

[Configuring the Lily HBase NRT Indexer Service for Use with Cloudera Search][1]

> As HBase applies inserts, updates, and deletes to HBase table cells,
> the indexer keeps Solr consistent with the HBase table contents, using
> standard HBase replication.

Not sure if`truncate 'hTable'` is also supported in the same.

Else you create a Trigger or Service to clear up your data from both Solr and HBase on a particular Event or anything.

[1]:

[To see links please register here]

Reply

#14
Post json data (e.g. with curl)

curl -X POST -H 'Content-Type: application/json' \
'http://<host>:<port>/solr/<core>/update?commit=true' \
-d '{ "delete": {"query":"*:*"} }'
Reply

#15
If you want to clean up Solr index -

you can fire http url -

[To see links please register here]

:port/solr/[core name]/update?stream.body=<delete><query>*:*</query></delete>&commit=true

(replace `[core name]` with the name of the core you want to delete from). Or use this if posting data xml data:

<delete><query>*:*</query></delete>

Be sure you use `commit=true` to commit the changes

Don't have much idea with clearing hbase data though.
Reply

#16
Solr I am not sure but you can delete all the data from hbase using truncate command like below:

truncate 'table_name'

It will delete all row-keys from hbase table.
Reply

#17
From the command line use:

bin/post -c core_name -type text/xml -out yes -d $'<delete><query>*:*</query></delete>'
Reply

#18
I tried the below steps. It works well.

- Please make sure the SOLR server it running
- Just click the link [Delete all SOLR data][1] which will hit and delete all your SOLR indexed datas then you will get the following details on the screen as output.

```xml
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">494</int>
</lst>
</response>
```

- if you are not getting the above output then please make sure the following.
- I used the default `host` (localhost) and `port` (8080) on the above link. please alter the host and port if it is different in your end.
- The default core name should be `collection` / `collection1`. I used `collection1` in the above link. please change it too if your core name is different.



[1]:

[To see links please register here]

Reply

#19
To delete all documents of a Solr collection, you can use this request:
```
curl -X POST -H 'Content-Type: application/json' --data-binary '{"delete":{"query":"*:*" }}'

[To see links please register here]

```

It uses the JSON body.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through