Hi everybody, First-time poster here. I've got a search index that I am using to index live Java objects. I create a Document with the appropriate fields and index them. No problem. I am indexing objects of different types, so I have an "id" field in each Document which consists of the object's class name followed by a unique ID number, so for example "com.mycompany.myapp.FooBar142". When the objects get updated, I make a new Document and call IndexWriter.updateDocument as follows:
IndexWriter indexWriter = new IndexWriter(INDEX_PATH, new StandardAnalyzer(), false); Document doc = buildDocumentFor(object); Term term = new Term("id", "\"" + doc.get("id") + "\""); indexWriter.updateDocument(term, doc); indexWriter.close(); The call to update() goes off without any problems, and the new Document gets added to the index. But when checking the index, I find that the old Document still exists. Am I missing something? The Javadoc for updateDocument states "Updates a document by first deleting the document(s) containing term and then adding the new document. The delete and then add are atomic as seen by a reader on the same index (flush may happen only after the add)." Thanks for your help.. -- Joe Attardi [EMAIL PROTECTED] http://thinksincode.blogspot.com/