- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
how can we delete a multiple rows in Apache Solr ?
- Labels:
-
Apache Solr
Created ‎06-18-2018 01:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Team,
how can we delete a multiple rows in Apache Solr ? Can you please explain with CURL Command
Thanks in advance...!!!
Regards,
Satya Nittala
Created ‎06-18-2018 01:44 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To delete all documents
single core:
curl 'http://localhost:8080/solr/update' -H "Content-type: text/xml" --data-binary '<delete><query>*:*</query></delete>' curl 'http://localhost:8080/solr/update' -H "Content-type: text/xml" --data-binary '<commit />'
mutliple core:
curl 'http://localhost:8080/solr/<core-name>/update' -H "Content-type: text/xml" --data-binary '<delete><query>*:*</query></delete>' curl http://localhost:8080/solr/update -H "Content-type: text/xml" --data-binary '<commit />'
If you like to delete using a query filter instead of all, just use the filter criteria you like. For example the following will delete only the documents for city=Santiago
<delete> <query>city:Santiago</query> </delete>
Also note the above curl commands are not specifying --negotiate -u : please add those if you have kerberos enabled cluster.
HTH
*** If you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.
Created ‎06-19-2018 03:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for quick response
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>'
