That happens only if SignatureUpdateProcessor is used and configured
with overwriteDupes=true. In such a case, a BQ is constructed which
has the new signature term excluded and the id term included so that
an old document with same uniqueKey but different signature is
deleted.

On Tue, Sep 17, 2013 at 4:28 PM, Per Steffensen <[email protected]> wrote:
> 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]
>



-- 
Regards,
Shalin Shekhar Mangar.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to