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

Fixed bug: If a field of a filter had no value it would throw a core exception...

Fixed bug: If a field of a filter had no value it would throw a core exception because no pattern with an empty value could be created. Now the value gets trimmed and in case of emptyness ignored.
Workaround, if the prefilter json contains an empty value it gets translated to null by indexsearch.buildQueryFromSearchCondition with which nothing would be found. The null value now gets temporarily replaced. Hast to be removed when the api has been fixed!
Specific line to remove:
indexPattern = indexPattern.replace(null, "");//todo remove if api has been fixed
parent 574c282b
No related branches found
No related tags found
No related merge requests found
......@@ -1097,6 +1097,8 @@ _DuplicateScannerUtils._callIndexSearch = function(pTargetEntity, pPreFilterJson
//The pPreFilterJson is never null because it always contains at least the default ignore record filter
indexPattern = indexsearch.buildQueryFromSearchCondition(pPreFilterJson);
indexPattern = indexPattern.replace(null, "");//todo remove if api has been fixed
let filterPatternConfig = _DuplicateScannerUtils._buildFilterPatternConfig(pEntityFieldValueRays, pTargetEntity);
if(filterPatternConfig != null)
......@@ -1116,8 +1118,7 @@ _DuplicateScannerUtils._callIndexSearch = function(pTargetEntity, pPreFilterJson
if(filterPattern != null)
indexQuery = indexQuery.addFilter(filterPattern);
logging.log("indexQuery.getPattern -> " + indexQuery.getPattern());
logging.log("indexQuery.getFilters -> " + indexQuery.getFilters());
logging.log("indexQuery: PATTERN + FILTERS -> " + indexQuery.getPattern() + " " + indexQuery.getFilters());
return indexsearch.searchIndex(indexQuery);
}
......@@ -1186,7 +1187,7 @@ _DuplicateScannerUtils._buildFilterPatternConfig = function(pEntityFieldValueRay
filterPatternConfig = indexsearch.createPatternConfig();
for (let i = 1; i < pEntityFieldValueRays.length; i++)
{
let entityFieldValue = pEntityFieldValueRays[i][1];
let entityFieldValue = pEntityFieldValueRays[i][1].trim();
let entityFieldName = pEntityFieldValueRays[i][0];
//if(pEntityFieldValueRays[i][INDEX_CONFIG_USE_FOR_SEARCH] == 0 || entityFieldValue == "")
......
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