From a466c314303f040d9dca6765b8f8083eb4467933 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 26 Aug 2021 18:00:36 +0100 Subject: [PATCH] Update client side lucene implemenation to mirror real lucene by not matching when the value is nullish --- packages/standard-components/src/lucene.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/standard-components/src/lucene.js b/packages/standard-components/src/lucene.js index 50aae1f32c..d7af0e2512 100644 --- a/packages/standard-components/src/lucene.js +++ b/packages/standard-components/src/lucene.js @@ -103,12 +103,12 @@ export const luceneQuery = (docs, query) => { // Process an equal match (fails if the value is different) const equalMatch = match("equal", (key, value, doc) => { - return doc[key] !== value + return value != null && value !== "" && doc[key] !== value }) // Process a not-equal match (fails if the value is the same) const notEqualMatch = match("notEqual", (key, value, doc) => { - return doc[key] === value + return value != null && value !== "" && doc[key] === value }) // Process an empty match (fails if the value is not empty)