When I tried to update a single document in an index, I deleted it first and then added it to the index again. But when I do search both the old version and the new version show up. When I look at the index files, the deletable contains the files that are supposedly to be deleted, but somehow I could still search them. IndexReader is closed after the deletion, and a new IndexWriter is opened for the addition. Optimize() is called after adding the document. I tried to open a new IndexWriter after deletion and call its optimize() (then close()) before opening another IndexWriter for addition. The problem did not go away. I am using Lucene1.01.
Thanks for any help. Sheldon