If you're indexing a field like this in order to be able to use it as a
reference later, you should normally index it using Field.Keyword
instead of Field.Text - if you use Text, it will go through your
Analyzer, which is probably what's changing the case. (I think this is
right - I'm sure someone will correct me if I'm wrong!)

Cheers,

Tim.

-----Original Message-----
From: Bogdan Munteanu [mailto:[EMAIL PROTECTED] 
Sent: 16 September 2005 15:40
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!



********************************************************************************
The information contained in this email message may be confidential. If you are 
not the intended recipient, any use, interference with, disclosure or copying 
of this material is unauthorised and prohibited. Although this message and any 
attachments are believed to be free of viruses, no responsibility is accepted 
by T&F Informa for any loss or damage arising in any way from receipt or use 
thereof.  Messages to and from the company are monitored for operational 
reasons and in accordance with lawful business practices. 
If you have received this message in error, please notify us by return and 
delete the message and any attachments.  Further enquiries/returns can be sent 
to [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to