mirror of https://github.com/apache/lucene.git
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:
parent
4c5700cdc9
commit
1de21edefe
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue