Because when you add a document, the id is going thru an Analyzer, which in your case uses a low case filter, but when you create a Term object the term is not lower cased by an Analyzer.
If instead of using Field.Text for your ID, you'll use Keyword, then the Analyzer will not lower case the ID HTH Aviran http://www.aviransplace.com -----Original Message----- From: Bogdan Munteanu [mailto:[EMAIL PROTECTED] Sent: Friday, September 16, 2005 10:40 AM To: java-user@lucene.apache.org Subject: Deleting documents I have a problem when deleting documents. Lets say I have a Document object doc. doc.add(Field.Text("id","index1,DML")); doc.add(Field.Text("contents","some records")); IndexWriter.addDocument(doc); Now if I want to delete the document with id:index1,DML I do something like this: IndexReader.delete(new Term("id", "index1,DML")); And it is not deleted. I have debuged it and noticed that lucene compares my "index1,DML" parameter with it's internal value "index1,dml". So when I do: IndexReader.delete(new Term("id", "index1,dml")); the document is deleted. Now please explain me why is there a lower case value for my "id"? And excuse my poor english! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]