Browse Source

Removed notOneOf

master
Mel O'Hagan 4 years ago
parent
commit
2925e171aa
  1. 4
      packages/frontend-core/src/constants.js
  2. 9
      packages/frontend-core/src/utils/lucene.js

4
packages/frontend-core/src/constants.js

@ -46,10 +46,6 @@ export const OperatorOptions = {
value: "oneOf", value: "oneOf",
label: "Is in", label: "Is in",
}, },
NotIn: {
value: "notOneOf",
label: "Is not in",
},
} }
// Cookie names // Cookie names

9
packages/frontend-core/src/utils/lucene.js

@ -94,7 +94,6 @@ export const buildLuceneQuery = filter => {
contains: {}, contains: {},
notContains: {}, notContains: {},
oneOf: {}, oneOf: {},
notOneOf: {},
} }
if (Array.isArray(filter)) { if (Array.isArray(filter)) {
filter.forEach(expression => { filter.forEach(expression => {
@ -219,11 +218,6 @@ export const runLuceneQuery = (docs, query) => {
return !testValue?.includes(docValue) 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 // Match a document against all criteria
const docMatch = doc => { const docMatch = doc => {
return ( return (
@ -234,8 +228,7 @@ export const runLuceneQuery = (docs, query) => {
notEqualMatch(doc) && notEqualMatch(doc) &&
emptyMatch(doc) && emptyMatch(doc) &&
notEmptyMatch(doc) && notEmptyMatch(doc) &&
oneOf(doc) && oneOf(doc)
notOneOf(doc)
) )
} }

Loading…
Cancel
Save