diff --git a/src/server/es/filter.js b/src/server/es/filter.js index 8c4fc6b6..3058f32c 100644 --- a/src/server/es/filter.js +++ b/src/server/es/filter.js @@ -85,6 +85,7 @@ const getFilterItemForString = (op, pField, value, path) => { [field]: value, }, }; + case 'CONTAINS_ANY': case 'in': case 'IN': // if using missingDataAlias, we need to remove the missingDataAlias from filter values @@ -121,13 +122,32 @@ const getFilterItemForString = (op, pField, value, path) => { [field]: value, }, }; + case 'CONTAINS_ALL': + return { + bool: { + must: value.map((v) => ({ + term: { [field]: v }, + })), + }, + }; case '!=': + case 'EXCLUDES_ANY': + return { + bool: { + must_not: value.map((v) => ({ + term: { [field]: v }, + })), + }, + }; + case 'EXCLUDES_ALL': return { bool: { must_not: [ { - term: { - [field]: value, + bool: { + must: value.map((v) => ({ + term: { [field]: v }, + })), }, }, ],