tags:

views:

86

answers:

0
IndexWriter writer = new IndexWriter(IndexPath, analyzer, false);   
writer.DeleteDocuments(new Term("Id", topicId));
writer.Flush(true, true);
writer.Close();

This code successfully queues up the document for deletion, but doesn't actually do it. I need it to be done right away as I can't have old documents in the index. What am I doing wrong? I have verified that loading the document with that term does work.