Hi, As Tom suggested removing optimize and passing the ids as list (instead of for loop) will surely increase the speed of deletion.
We have a program which fetches complete list of ID from back end (around 10 million) and compares it with the complete list of id's present in SOLR document and deletes the document corresponding to the id's that are not present in the DB from SOLR document.. The whole program takes just couple of minutes.. You can have a separate batch program to optimize your index.. Optimization will be really useful when you are using terms component as the terms wont get refreshed unless you optimize your index.. Thanks, Barani -- View this message in context: http://lucene.472066.n3.nabble.com/Delete-by-query-or-Id-very-slow-tp2053699p2067952.html Sent from the Solr - User mailing list archive at Nabble.com.