From 85859e48afe1be13d8d4ca50c78c98c4cf75599d Mon Sep 17 00:00:00 2001 From: Evildoor Date: Wed, 22 May 2019 13:02:05 +0200 Subject: [PATCH] Remove service fields before checking. Service fields are different from data fields and shouldn't be checked. --- Utils/Dataflow/071_esConsistency/consistency.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utils/Dataflow/071_esConsistency/consistency.py b/Utils/Dataflow/071_esConsistency/consistency.py index a9ad2b5b4..5e683357f 100755 --- a/Utils/Dataflow/071_esConsistency/consistency.py +++ b/Utils/Dataflow/071_esConsistency/consistency.py @@ -160,6 +160,11 @@ def process(stage, message): if field in data: del data[field] + # Fields starting with an underscore are service fields. Some of them are + # treated in special way (see _id above). Service fields should not be + # checked, so they are removed. + data = {field:data[field] for field in data if field[0]!='_'} + # Do not check empty documents with valid _id and _type. # It's unlikely that such documents will be produced in DKB. In general, # such documents should be checked by es.exists(), and not es.get().