My apologies, the IndexReader code I included was a commented out trial. Here is the active version. Sorry for the error:
IndexReader ir = IndexReader.open(indexDir);
System.out.println(">>>" + ir.numDocs());
int deleted = ir.deleteDocuments(new Term("filename"
,f.getAbsolutePath()));
System.out.println("deletes?" + ir.hasDeletions());
ir.close();
if (deleted > 0) {
System.out.println("deleted old index of " +
f.getAbsolutePath());
}
