This is kind of a problem, in order to delete documents using terms you need
to have a keyword field which contain a unique value, otherwise you might
ending deleting more then you want.
-----Original Message-----
From: Mike Hogan [mailto:me@mikehogan.net]
Sent: Friday, December 05, 2003 1:06 PM
To: lucene-user@jakarta.apache.org
Subject: How would you delete an entry that was indexed like this
Hi,
If I index a document like this:
IndexWriter writer = createWriter();
Document document = new Document(); document.add(Field.Text(ID_FIELD_NAME,
componentId)); document.add(Field.Text(CONTENTS_FIELD_NAME,
componentDescription)); writer.addDocument(document); writer.optimize();
writer.close();
What code must I execute to later delete the document (I tried following the
docs and whats done in the code and test cases. I saw Terms being used to
ID the document to delete. But I am not clear what value to put in the
Term, as I do not know how Terms relate to Fields).
Many thanks,
Mike.
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
|