Dhanraj Bhoite
Dhanraj Bhoite

Reputation: 1

Re: how can we delete a multiple rows in Apache Solr?

I need to delete around 100 records , Each one having unique identity number

is their any way to delete in a single shot

Since below process is taking more time for million of records

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 101</query></delete>'

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 1058262 </query></delete>'

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 74965103</query></delete>'

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 1895604 </query></delete>'

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 1023135</query></delete>'

....

....

....

....

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 18465498</query></delete>'

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 1878999</query></delete>'

curl 'http://localhost:8080/solr/<core-name>/update'-H "Content-type: text/xml"--data-binary '<delete><query> dataid : 222100</query></delete>'

Upvotes: 0

Views: 129

Answers (1)

Abhijit Bashetti
Abhijit Bashetti

Reputation: 8658

You can pass the multiple ids of the document in a single request for the deletion as below.

Field_Name:(Value1 OR Value2 OR Value2 .. )

In your case it would be something like below.

curl 'http://localhost:8080/solr//update'-H "Content-type: text/xml"--data-binary ' dataid : ( 18465498 OR 1878999 OR 222100)'

Upvotes: 1

Related Questions