BlackLab
BlackLab copied to clipboard
Don't allow adding a document with the same pid twice
Right now, BlackLab doesn't check the configured pid field when adding documents. So it's possible to add a document twice; two copies will exist in BlackLab that have the same pid. Behaviour when e.g. retrieving this document by pid is undetermined; likely one of the copies will be chosen more or less at random.
Instead, BlackLab should ideally detect the situation and either reject the document (requiring an explicit delete of the existing document first), or (probably more helpful) replace the existing document with the new version. We could even make the behaviour configurable.