lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From flateric <eballn...@yahoo.de>
Subject neither IndexWriter nor IndexReader would delete documents
Date Sun, 18 Nov 2007 22:16:07 GMT

Hallo *;

I went through some examples of the Lucene in Action book to find that the
API has changed and then applied the corrections with the help of this
forum.
One runtime problem however remains. I cannot delete any documents.
I store documents like this:

IndexWriter iw = new IndexWriter(
	new File(Constants.INDEX_FILENAME), new StandardAnalyzer());
Document document = new Document();
...
document.add(new Field("doc", doc, Field.Store.YES, Field.Index.NO));
iw.addDocument(document);
iw.optimize();
iw.close(); 

Which works fine. But deleting them like this:

Directory fsDir = FSDirectory.getDirectory(new File(
	Constants.INDEX_FILENAME));
IndexReader ir = IndexReader.open(fsDir);
ir.deleteDocuments(new Term("uid", uid));
ir.close();

Has absolutely no effect. I also tried delete on the IndexWriter - no
effect.
Please help! I don't know where to investigate any further!

Thx Eric
-- 
View this message in context: http://www.nabble.com/neither-IndexWriter-nor-IndexReader-would-delete-documents-tf4832123.html#a13824599
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message