You will need to open the index without overwriting this way:
IndexWriter writer = new IndexWriter("MyIndexPath",analyzer, false);
The flag flag at the end tells it to open in add mode.
The author has an UpdateDocument method
writer.UpdateDocument(new Term("IDField",id), doc);
the id field must be a unique identifier for the document, such as a file name or file number, etc.
Mikos
source share