diff --git a/process/IndexSearch_lib/process.js b/process/IndexSearch_lib/process.js index 549aefab097b21cce5c1053bf013ec1daa322be9..0c2635e1955004b54dbe446963080d4b9d9dda21 100644 --- a/process/IndexSearch_lib/process.js +++ b/process/IndexSearch_lib/process.js @@ -290,13 +290,24 @@ IndexsearchFilterRow.prototype.buildQuery = function(pFieldValues) * * @param {string} pName the row field name * @param {string} pOperator the operator for the group can either be 'AND' or 'OR' - * @param {string} pValue the field valze + * @param {string} pValue the field value */ IndexsearchFilterRow.fromFilter = function(pName, pOperator, pValue) { if(pOperator == "NOT_EQUAL" || pOperator == "CONTAINSNOT") { - return new IndexsearchFilterRow(pName, true, JSON.parse(pValue)); + let exclude; + try + { + exclude = JSON.parse(pValue); + } + // If the pValue isn't an Object or Array + catch (e if e instanceof SyntaxError) + { + exclude = [pValue]; + } + + return new IndexsearchFilterRow(pName, true, exclude); } else if(pOperator == "ISNOTNULL") {