lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Cota <>
Subject Deleting documents that meet a query
Date Mon, 09 Jun 2003 16:11:13 GMT
I need to delete all the documents from an index that
satisfy a BooleanQuery.

The only methods I can find (in IndexReader) for deleting
a document are delete(Term) and delete(int).

I tried searching on my Query using,
iterating over each document in the returned Hits,
and then iterating over Hits deleting each document like this:

for (int i=0; i<hits.length(); +++i) {

Hoping here that the value returned by is the "docnum" expected in

But the call to delete throws an IOException.

So, is there any way I can delete all the documents from
an Index that satisfy a general Query?

Thank you for any advice.

Bruce Cota,
Unicon, Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message