Hi I want to delete a document in lucene 2.4 with java. My code is
Directory directory = FSDirectory.getDirectory("c:/index");
IndexReader indexReader = IndexReader.open(directory);
System.out.println("num="+indexReader.maxDoc());
indexReader.deleteDocuments(new Term("name","1"));
System.out.println("num="+indexReader.maxDoc());
output
num=1
num=1