From abcf9752c1ee99486584deafda602a6f467e0d91 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 24 Jun 2022 21:29:19 +0100 Subject: [PATCH] Removed notOneOf --- packages/frontend-core/src/constants.js | 4 ---- packages/frontend-core/src/utils/lucene.js | 9 +-------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/packages/frontend-core/src/constants.js b/packages/frontend-core/src/constants.js index ddc327411c..f69590f720 100644 --- a/packages/frontend-core/src/constants.js +++ b/packages/frontend-core/src/constants.js @@ -46,10 +46,6 @@ export const OperatorOptions = { value: "oneOf", label: "Is in", }, - NotIn: { - value: "notOneOf", - label: "Is not in", - }, } // Cookie names diff --git a/packages/frontend-core/src/utils/lucene.js b/packages/frontend-core/src/utils/lucene.js index 270de05011..a99ff6cf8b 100644 --- a/packages/frontend-core/src/utils/lucene.js +++ b/packages/frontend-core/src/utils/lucene.js @@ -94,7 +94,6 @@ export const buildLuceneQuery = filter => { contains: {}, notContains: {}, oneOf: {}, - notOneOf: {}, } if (Array.isArray(filter)) { filter.forEach(expression => { @@ -219,11 +218,6 @@ export const runLuceneQuery = (docs, query) => { return !testValue?.includes(docValue) }) - // Process a not included match (fails if the value is included) - const notOneOf = match("notOneOf", (docValue, testValue) => { - return testValue?.includes(docValue) - }) - // Match a document against all criteria const docMatch = doc => { return ( @@ -234,8 +228,7 @@ export const runLuceneQuery = (docs, query) => { notEqualMatch(doc) && emptyMatch(doc) && notEmptyMatch(doc) && - oneOf(doc) && - notOneOf(doc) + oneOf(doc) ) }