SOLR-587: use Lucene's deleteByQuery

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@661778 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yonik Seeley 2008-05-30 16:10:09 +00:00
parent 4c5700cdc9
commit 1de21edefe
1 changed files with 4 additions and 9 deletions

View File

@ -310,14 +310,9 @@ public class DirectUpdateHandler2 extends UpdateHandler {
if (delAll) {
deleteAll();
} else {
closeWriter();
openSearcher();
// if we want to count the number of docs that were deleted, then
// we need a new instance of the DeleteHitCollector
final DeleteHitCollector deleter = new DeleteHitCollector(searcher);
searcher.search(q, null, deleter);
totDeleted = deleter.deleted;
closeSearcher();
openWriter();
writer.deleteDocuments(q);
}
} finally {
iwCommit.unlock();