Hi
Code in DirectUpdateHandler2.addDoc looks something like this
writer.updateDocument(updateTerm, luceneDocument,
schema.getAnalyzer());
if (del) { // ensure id remains unique
BooleanQuery bq = new BooleanQuery();
bq.add(new BooleanClause(new TermQuery(updateTerm),
Occur.MUST_NOT));
bq.add(new BooleanClause(new TermQuery(idTerm), Occur.MUST));
writer.deleteDocuments(bq);
}
The JavaDoc for IndexWriter.updateDocument says
Updates a document by first deleting the document(s)
containing <code>term</code> and then adding the new document
If updateDocument deletes the "old document" why do we also do the "if
(del) ..." part to delete it (again)? What did I oversee?
Regards, Per Steffensen
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]