I am using Lucene to index a directory with relatively large number (dozens of thousands) dynamically created/update/deleted files. I have one Lucene document per file and the file name is one of fields in the document.
Document doc = new Document();
doc.add(new StringField("id", file.getName(), Store.YES));
doc.add(new LongField("stamp", file.lastModified(), Store.YES));
doc.add(new StringField("path", file.getAbsolutePath(), Store.YES));
How do I (the faster the better) iterate all documents in the index referring to the files missing on the file system?