diff --git a/process/RebuildDuplicatesCache_serverProcess/process.js b/process/RebuildDuplicatesCache_serverProcess/process.js index ddefb4cad93b7e672aced9cae089ef0216170ce0..d7ee47f9636e9db46a82c9afe9590e13c32d9931 100644 --- a/process/RebuildDuplicatesCache_serverProcess/process.js +++ b/process/RebuildDuplicatesCache_serverProcess/process.js @@ -1,5 +1,8 @@ import("DuplicateScanner_lib"); + +// Build Organisation duplicate cache + var filterName = "PersonDuplicates"; var targetEntity = "Person_entity"; var resultFieldsIdFieldName = "CONTACTID"; @@ -14,4 +17,20 @@ tmpFieldsInFilterRay, resultFieldsIdFieldName); DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); -//todo Refresh der Organisation duplicates \ No newline at end of file + +// Build Organisation duplicate cache + +filterName = "OrganisationDuplicates"; +targetEntity = "Organisation_entity"; +resultFieldsIdFieldName = "CONTACTID"; +queryPersonContactIds = "select CONTACTID, ORGANISATION.\"NAME\" from ORGANISATION" + + " join CONTACT on CONTACT.CONTACTID = ORGANISATION.ORGANISATIONID" + + " where CONTACTID != '0'"; +tmpFieldsInFilterRay = ["CONTACTID", "NAME"]; + +DuplicateScannerUtils.DeleteDuplicateClustersByTargetEntity(targetEntity) + +DuplicateScannerUtils.RebuildDuplicatesCache(filterName, targetEntity, queryPersonContactIds, +tmpFieldsInFilterRay, resultFieldsIdFieldName); + +DuplicateScannerUtils.RefreshUnrelatedDuplicateRelations(targetEntity); \ No newline at end of file