Skip to content
Snippets Groups Projects
Commit f0b25cf3 authored by David Büchler's avatar David Büchler
Browse files

Fixed bug where an error was thrown if a field is used to search for...

Fixed bug where an error was thrown if a field is used to search for duplicates and it's value was empty. These fields will now be ignored.
parent 07283023
No related branches found
No related tags found
No related merge requests found
......@@ -920,7 +920,7 @@ pResultFields, pRecordIdFieldToIgnore, pRecordIdValueToIgnore, pFormatValuesCons
//No prefilter and no filterfields => No indexsearch
if(preFilter == null && pFilterFieldValueRays.length < 1)
return null;
//If at this point the prefilter is null but a search has to be executed, add the ignorefilter manually that the search doesn't find the base record as duplicate to itself.
//This is the case if no prefilter but indexfields are configured.
if(preFilter == null)
......@@ -933,7 +933,7 @@ pResultFields, pRecordIdFieldToIgnore, pRecordIdValueToIgnore, pFormatValuesCons
return null;
possibleDuplicates = possibleDuplicates[indexsearch.HITS];
logging.log("possibleDuplicates -> " + possibleDuplicates.length);
if(pUseExternalWebservice && possibleDuplicates.length > 0 && pFormatValuesConsumeWebserviceCallback != null)
possibleDuplicates = pFormatValuesConsumeWebserviceCallback.apply(this, [possibleDuplicates]);
......@@ -1103,7 +1103,7 @@ _DuplicateScannerUtils._callIndexSearch = function(pTargetEntity, pPreFilterJson
if(filterPatternConfig != null)
filterPattern = indexsearch.buildPatternString(filterPatternConfig);
//The indexPattern can't be null because it is required to run the search.
if(indexPattern == null)
return null;
......@@ -1181,28 +1181,25 @@ _DuplicateScannerUtils._buildFilterPatternConfig = function(pEntityFieldValueRay
let INDEX_CONFIG_USE_FOR_SEARCH = 2;
let filterPatternConfig = null;
//logging.log("pEntityFieldValueRays.length -> " + pEntityFieldValueRays.length);
if(pEntityFieldValueRays.length > 1)
{
filterPatternConfig = indexsearch.createPatternConfig();
for (let i = 1; i < pEntityFieldValueRays.length; i++)
{
let entityFieldValue = pEntityFieldValueRays[i][1].trim();
let entityFieldValue = pEntityFieldValueRays[i][1];
let entityFieldName = pEntityFieldValueRays[i][0];
//if(pEntityFieldValueRays[i][INDEX_CONFIG_USE_FOR_SEARCH] == 0 || entityFieldValue == "")
if(entityFieldValue == "")
if(entityFieldValue == undefined || entityFieldValue == "")
continue;
//logging.log("entityFieldValue -> " + entityFieldValue);
//logging.log("entityFieldName -> " + entityFieldName);
entityFieldValue = entityFieldValue.trim();
let indexField = indexsearch.lookupIndexField(pTargetEntity, entityFieldName);
//logging.log("indexField -> " + indexField);
var filterTerm = indexsearch.createTerm(entityFieldValue)
.setIndexField(indexField);
if(pEntityFieldValueRays[i][INDEX_CONFIG_USE_FOR_SEARCH] == 1)
{
logging.log("Nutze fuzzy search -> ");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment